android - how to reset the zoom level of the image to original? -


i need set zoom level of image (in imageview) original state i.e fits imageview , zoom-in has been removed. have tried store image matrix value @ time of opening image (when fit screen) , on 'reset' button click assign value imageview zoomed in (and might have modified matrix); not helping.. not sure if related matrix defines zoom level of image or there else need set. code snippet:

ps. 'zoommatrix' image matrix @ time when image has opened n fit screen. 'touch' object of class extending imageview.

resetzoom.getitem().setonmenuitemclicklistener(      new menuitem.onmenuitemclicklistener() {         public boolean onmenuitemclick(menuitem item) {              touch.setimagematrix(touch.zoommatrix);             touch.setscaletype(scaletype.matrix);             touch.invalidate();              return true;         } }); 

you need is, implement simple code in reset button

setcontentview(r.layout.activity_image); 

this reset activity original scale/position...


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -