-
Notifications
You must be signed in to change notification settings - Fork 384
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
Zoom image smaller than viewport and move it within viewport #69
Comments
Not sure if I understand it correctly, but probably you need to set If you want to be able to zoom out any image to the size smaller than viewport then it is probably not possible. But in this case, what is your use case? |
I'm currently using the GestureViews API in a tracing app. The user selects an image, and adjusts a template image to the desired size/rotation for tracing on a physical paper. There are times when they want to reduce the template image to a size smaller than the image view. https://play.google.com/store/apps/details?id=twitch.angelandroidapps.tracerlightbox |
Ok, I see. You can try to play around with setMovementArea(int w, int h) |
Have you tried |
disableBounds() works, but now it is easy to accidentally 'flip' the shrunken image out of view. Is there a way to ensure that the image can be shrunk and still be constrained within the view? |
Have you tried In general, your use case seems pretty specific, so I can't see any obvious options how to implement an unlimited zooming within limited area. You can probably try to hack the way image size is calculated in GestureImageView, so the lib will think that image is bigger than it is and will allow you to zoom it our below min zoom level, but I can't help you here much. |
I didn't have much luck with setMovementArea either, because often times users wants to Zoom out instead of shrink the image. so I would need the full area for movement. disableBounds don't work with in conjunction with setMovementArea also. I'll see if I can hack out something like a "disableZoomBounds + setMovementArea" method. btw, are there any methods to
|
Yes, but it will require some math from you:
Then you can just check that image is outside of the view using:
Note, that if image was rotated then this will be a bounded rect around image's rotated rect. So you may need a bit more complicated calculations, if you want to do it 100% correct.
If you want to animate state then:
|
the Api does the zoom function amazingly.
Is it possible to go the opposite direction and have a function to shrink the images (make the image smaller than the image view)?
Currently, the image snaps back to the size of the image view when trying to shrink the image.
The text was updated successfully, but these errors were encountered: