-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to reset zoom? #6
Comments
You could try setting an identity matrix to the ImageView like so:
This would reset all transforms on the image such as scaling and translations. I am not sure if the last row is required for the view to update properly. You should try it out yourself. |
Unfortunately, that gave other problems. Load a photo into the zoomable ImageView, zoom it, close it. Open another, and it's fit to the space, but you can't zoom it at all. Also, where normally a landscape photo is centered vertically, the "broken" ones are at the top of the space. I simplified everything as much as I could in a test version, and I've ended up just making a new ImageView to hold the zoomable full screen image, and removing it entirely when the zoomed image is closed. |
I have the same issue as @sashafiero Until we find a real solution, I followed what @sashafiero did with "making a new ImageView"
|
My solution to this problem: |
@vladislav1nikov Thanks for the solution, it worked for me.. |
I can't figure out how to reset the zoom level. I am using one ImageView, into which I am loading one image at a time (from a thumbnail) for zooming with. However, if I open one, zoom in a bit, close it (hiding the imageview), then open another image, it shows up at the same zoom level as the one before it.
I tried setting a new ImageMatrixTouchHandler on the zoomed in ImageView every time I load in a new pic, but that didn't help.
I also tried making a "standalone" ImageMatrixTouchHandler ahead of setting it on the ImageView, with the thought that I could try
myImageMatrixTouchHandler.animateZoom(0, 0)
but I get aAttempt to invoke virtual method 'void android.graphics.Matrix.getValues(float[])' on a null object reference
The text was updated successfully, but these errors were encountered: