Implement zoom functionality in layout having images - android

I want to implement pinch zoom functionality for a layout which have a background image and on background image it have 4 another image . see the image
I have 2 idea to implement my problem
Make a parent layout (framelayout) which will have these 4 images as child layout(imageview) and somehow (i dont know how) if i am able to make it pinch zoom. my problem will get solved
i can use webview but i dont know how to put these images in webview.
can anyone help me to get it solved.
Note : i want pinch zoom functionality only for background image. as if background image will get zoom, other images will also get zoomed. i dont want independent zoom for images 1 2 3 4.
Thanks

All layouts are already put in to the default FrameLayout, so, Merge as a root layout is enough.
As for zooming the main image, the only problem IMHO, is that these children could sometime catch the event instead of the root layout. So, you need do make them unfocusable and disabled. After that all events will be catched by the parent.

Related

How to do a grid (10000 x 10000) clickable and zoomable in xamarin forms

I've been looking for a solution to my problem for weeks, and can't find out anything close to what I want. I need a big grid something at least 10000x10000 and even more if I can. The objective is to change the color of the cell that have been clicked. To do so users should be able to zoom in and click in one cell to modify it color. Then obviously zoom out.
I first thought to pick an image and make it clickable but to change the color of only 1 cell it would be impossible in an image.
Then I tried to do a grid with buttons inside and change their color on click, but way to long to create those inside the content page, same for labels.
Any suggestion ?
Thanks for reading
I don't believe you can do this with existing UI & Layout controls.
It will be extremely slow and hard to do.
You should use a graphic library such SkiaSharp. Here is a good tutorial to do it.
You might use pan & pinch gesture for zooming as well(howto).

How to multi touch and move view on image like a camera?

I'm working on image multi touch events, that have an image with touchEvents like googleMaps's touchEvents( pinchZoom and move togather with 2 fingers ), I tried GestureImageView and cusomized it and could implement that. but I'm not sure it is correct way or there is another method for it.Is there any way to do that ?
also I want to show different parts of the large image by clicking on each part and show theme so that it seams that camera moves view on the image.
Is there any library or any tools for this purpose in android?
I will be appreciate if help me.
Thank you.

How to build a large image viewer

I need to build a component to view large images.
I cannot put the ImageView in a ScrollView because I will need to be handle other touch events on the image.
The ideal would be to build a "viewer"
with an horizontal handle
and a vertical handle
that enable to move where the picture is centered so that I can scroll the image using the handles without touching the picture itself.
I would like to achieve something like in the following picture, I have researched but I was not able to find any Android API or other component/library that I could use.
Thank you very much for any suggestion.
Best thing I can think of is use two custom scrollbars for the horizontal and vertical scroll. In an onChange() function you can change the crop area on the master image and display the cropped image. Depedning on how it is done you can get a slide effect going for the image.

Image auto scrolling in android

I want to create an image auto scrolling for an outer-space type of game. To make it more exact, I want to load 2 background image that uses a single image occupying the whole screen and auto-scroll it alternatively to create an animation that the background image is moving. Don't get confused with auto scrolling and and shifting to another image automatically. I really meant auto scrolling like moving background using 1 image.
I did some research but what I saw are segments of java codes that made me confused. If possible can anyone provide me an example? From loading the image from xml (should I use an imageview with this? or just set the background image of the layout?) and how I should process it in java code to make an image autoscrolling.
Any ideas guys? Thanks! Sorry for asking too much.

Overlay a static image on a MapView

I'm still a newbie to Android but have searched high and low for an answer to my problem without success.
I have a map view that the user can fully manipulate (scroll, enlarge etc.) but I need to let the user know where the midpoint of the map is. I want to use a small "crosshair" image for this and display it at the centre of the map AT ALL TIMES and AT ALL LEVELS OF MAGNIFICATION. In fact, I just want the image to remain on view at all times. Can I find a way to do this? Can I hell!
I'm sure there is a very simply solution to this from one or two of you gurus out there. Please help.
Tony
In your layout file that contains the MapView, make sure that the Layout container is of type RelativeLayout. Then simply add the ImageView as a child of the RelativeLayout, with an attribute of layout_gravity="center"
Basically, research RelativeLayout.

Categories

Resources