Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create imageview with zoom and pan functionality?

I created an app that has a small image loaded from URL of a website. I want that when user clicks on that small image it'll show the image in full screen and will also have the ability to zoom and pan that image.

What I've done was showing the image in WebView with built-in zoom controls but the result was ugly. (I've set the layout to wrap_content so no white areas are shown, but it cause the image doesn't zoom dynamically).

Any solution? and sorry for my bad English.

like image 429
Bigdragon Avatar asked Feb 02 '23 11:02

Bigdragon


2 Answers

Problem solved! For anyone who have the same problem, I've use this library and it works great! http://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/

Here's a link to the Github ImageViewZoom page.

like image 55
Bigdragon Avatar answered Mar 15 '23 09:03

Bigdragon


You can build that from scratch or... you can use this library:

http://code.google.com/p/android-pinch

Take a look at the PinchImageView class

like image 44
Cristian Avatar answered Mar 15 '23 07:03

Cristian