Scrolling Image in Image View? - android

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.

Related

Android: make the size of a custom view bigger than the size of screen

enter image description hereI have a custom view and the user can draw rectangles(I used canvas). I would make the size of custom view bigger than the size of the screen. So, the user can draw not only in the size of screen. I tried ScrollView and NestedScrollView but they are not helpful to solve my problem.
As far as I could understand from this question is you want to make a canvas where someone can draw some pictures. So you need a bigger canvas to that user can drag the positions to left-right, up and down. If I understood correctly, then I would say, you might think of a different work-around instead of looking for a view bigger than the screen size.
You can think of an simple ImageView which will be auto zoomed-in and if the user clicks twice it'll zoom-out. The user can drag the positions of the ImageView whenever he wants.
Here's an SO answer about how you can implement the zoom in and out in an ImageView. Hope this will help to solve your problem.

How to display other image when I scroll screen?

I have two images in drawable. I am using the ImageView to display them. However, I want to display each image individually by hand. At the first, I want to display image1.png. When I scroll left to right, it will be display images image2.png. Could you suggest to me the way to do it? Thank you so much
you can use ViewPager see this example http://developer.android.com/training/animation/screen-slide.html

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.

how to keep an image on top of other image

can anyone let me know how to keep an image on top of other image. If we select a portion of the top image it should display the below image portion.
Please share the samp
Thanks in advance.
-pavan
I'm not sure if this would completely answer your question... but firstly, images shouldn't really ever overlap in a LinearLayout. If you're using a RelativeLayout, they definitely can overlap, and the image on top will be whatever was loaded last in the XML.
If I understand what you're attempting to do - kind of transparency (so to speak) of the top image so that portions of the bottom image are displayed along with portions of the top image ... I do things like that all the time by overriding the onDraw() method on my View to handle the image painting myself. There's allot of examples on the net for this - simple stuff.

Zooming an ImageView

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/

Categories

Resources