Zooming an ImageView - android

This should be easy, but I'm having trouble figuring out how to zoom an ImageView. I have an ImageView inside of a ScrollView and a HorizontalScrollView. I floated a ZoomControls over the ImageView and now I'm trying to figure out how to actually zoom the image.
I was thinking I would just scale the Drawable inside of the ImageView, but I can't figure out an easy way to do this.
How should I be going about displaying an image that I can both zoom and scroll?
(And yes, I know about WebViews, but it seems wasteful to load an entire WebView just to display one image.)

I had tried to do a similar thing myself (a pair of scrollviews) in my app, and while it worked okay, I've since replaced it with the one-finger zoom described in this tutorial, and it works fantastic: http://blogs.sonyericsson.com/developerworld/2010/05/18/android-one-finger-zoom-tutorial-part-1/

Related

Android equivalent to UIImageViews in a UIView in a UIScrollView

I have a nice view in iOS and want to do the same in android, but couldn't find out how.
Basically it's one big background image and several smaller images overlayed and the whole needs to be zoomed at the same time, imagine for example a map with cars on it.
I tried working with a WebView, but couldn't configure it right, so I'm looking for a better solution. And I need the pinch zooming feature, the Webview -/+ was not really helpful.
Working code would be nice too, cause most examples I tried didn't work as expected.
Would be util put you ImageViews in a GridView?
http://developer.android.com/guide/topics/ui/layout/gridview.html
http://developer.android.com/reference/android/widget/ImageView.html

Scrolling Image in Image View?

I have an image which has a dimension of about 1200x800.. Now I would like to display it in an ImageView in such a way that the image would not scale down to fit the screen of the device but instead it will allow me to swipe to view the other parts of the image. Basically just like in the google's MapView. Is this possible with ImageView or should I use other methods? Thanks for your help.
I tried looking for answers in google but I just can't seem to find the right term for my problem so I always end up with nothing.

Implement zoom functionality in layout having images

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.

Android - ImageView as Offline map

I am trying to implement an offline map content into my android app. I need not so much detailed map just for a specific area and mark some places over it. a zoomable and scrollable image seems to be enough for me.
First question is;
1-) what is the best option for offline map in android? My constraint is that my app couldn't use any internet connection. Do I have to use an imageview (by adding button markers on it) or can I use any offline data for Mapview?
I have searched a lot for using imageview as map but couldn't get so much result.
my basic question for imageview is;
2-) How can I add a marker(a button) on a specific position of imageview?
I have found some sample code for scrolling and zoom and implemented them (Scrollview has no diagonal scroll as default) but I couldn't find a way to add marker to an scrollable, zoomable imageview.
Please don't think on sample code, just assume that imageview is in an scrollview and I try to add a marker(button) on it.
Thanks in advance
There are other options such as OSMDroid: But personal experience of this library would recommend using an imageview if you can and don't require zooming in and out and having performance issue.
You can have a scrollview, containing a horizontal scrollview, which can then contain a relative layout with an imageview taking up the space. Then add the markers to the relative layout and position accordingly.

How to implement scroll left-right,updown when we have a big image

When i get a bigger size bitmap image from server that takes double of width and height of my emulator screen. Now i want to see that image by scrolling the image up-down and also left-right to see full image.
Other option is to zoom-in the image.
please suggest answer for Both..i mean scroll view as well as zoom in..
I found the solution here :
Scrollview vertical and horizontal in android
tested it myself and it works like a charm
I also had the same issue so i am displaying the image using WebView. I have searched a lot on the net but doesn't find better solution. If someone has please let me know.

Categories

Resources