I am newbie in Android.I have followed this Question and i successfully zoom an image this code is working fine can someone please help me how to write code for zoomin zoomout on button click.I am not getting how to achieve this task
Here is the Tutorial that i followed Tutorial Zoom Image and also follow "Salman's Ayub Answer"
Its working fine but i am failed to apply scale factor on zoom in and zoom out of image
The easiest way to zoom in/out images on button, is to display it in a webView, then you can use all features offered by webView.
copy your image in assets folder, then load it in onCreate:
Try to use PhotoView. I think it does what you want out of the box.
You need to add these 2 methods to your
TouchImageView
class:Here is the complete
TouchImageView
class code, along with these 2 methods:Here how you can use them in your zoomIn/zoomOut buttons:
I hope this helps.