How to zoom in - out relative layout containing child views with the background image?
I am able to zoom in out relative layout but the background image bitmap on the relative layout is constant and not able to scale.
Maybe this can help you? It's library for zooming in/out an image view.
https://github.com/chrisbanes/PhotoView
Related
Is there a way to set the ScaleType of a ImageView as CENTER using Matrix ScaleType?
I'm in need of Center orientation of an image in the ImageView. Problem occurs when I set the size of the ImageView larger than the screen say 1000dp. By doing so my image sticks to the corners.
If I use layout_margins, I'm not able to pinch and zoom the image properly.
Please help me find a solution.
I want to draw A Rectangle over a Image In Horizontal And Vertical Direction Just Like a Grid.
I can use grid but when I Pan(Drag) image this won't work. The rectangle should also Pan with the Image or shold move with the Image.
The easiest way should be to have a view that draws the shape you want and your image together in a frame layout.
And then you should move the layout of both view rather than the view alone.
i want to increase the size of ImageView/ RelativeLayout by Dragging the corner of ImageView/ RelativeLayout. But no difference in width and set it bottom. I set it by using android:layout_alignParentBottom="true" and also set image in imageview. but how to drag i don't know. Is there is any option available in Android? can any one suggest some solution for this? pls help me
you can use onTouch() for the ImageView.
Once it is touched show a small image at the edge of the imageview. And on touching that image and moving(onTouch() gives the pixel positions until you touch it) you will be getting the pixel positions. Based on that you can set the height and width of the imageview.
I'm building a Facebook like image viewer. Meaning I use a ViewFlipper containing some ImageViewers which load their images asynchronously. The scale type of the ImageViews is set to matrix as I want to pinch zoom the images once they are loaded. So far so good.
I would like to centrally align the images, any idea how to do this?
I tried
to to change the scale type, this works but destroys my pinching behavior
to move the image with a matrix but the image isn't loaded yet so the width is 0
using an OnLayoutChangeListener but it's only added in API level 11
playing with the android:layout_gravity and android:gravity params in the XML
Should I subclass ImageView and add a callback myself?
I have a layout in which I resize an image by doing a transformation with prescale. After the scale the image has the right size, but the layout container around it cuts its size of. I want the layout container arround it to show to complete image.
I just tried invalidate on the image, the container as well as requestLayout(). Any ideas?
Thanks
How are you transforming the image? If you are setting a matrix on an ImageView, you need to tell the ImageView to adjust its bounds to the size of the content. If you are scaling the image by setting a transformation on the Canvas, you must change the dimensions of the View yourself.