Hi i am new to Android application i want to Zoom-in and Zoom-out ImageView.I tried most of the sample but in all that image in the imageview is get Zoom-in and Zoom-out.I want to Zoom-in and Zoom-out ImageView.I want to increase imageview width and height while Zoom-in and reduce imageview width and height while Zoom-out.Can any one suggest me?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Make two java classes
Zoom class
make second class
I have improved the answer I got from stack for flawless ZOOM (two finger) / ROTATION (two finger) / DRAG (Single finger).
//============================XML code==================
//============================Java code==========================
//========================Just pass any view which you want to zoom/rotate/drag to viewTransformation() method. Very applicable for textview zoom. It will not pixelate text.
Here is my solution, it is based on @alexbirkett's solution.
I think Chirag Ravals' answer is great!
The only thing it could be improved is moving all this code inside some class like:
and adding there initial Image Matrix initialization to prevent zooming after the first tap:
BTW, this will fix a bug mentioned by Muhammad Umar and Baz
P.S. Having Max and Min zoom limits could be also useful. E.g Max zoom is 2X and min zoom is the original scale when the image is fitted to screen:
ZoomLib Link: https://drive.google.com/uc?export=download&id=0B34PUThnUsjVaHpkaGk0Z1hSRU0
The other implementations here all have some kind of a flaw. so i basically mixed them up and came up with this.
Create a custom view like this:
ZoomableImageView.java:
Then add the image like this:
Add the view like this in XML: