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
You should put the image in webview and work with that. Zoom in / out controls are available in webview.
This code works and implement the double tap to return to original image size.
1st step - In your xml layout put this:
2nd step- Create a file (TouchImageView.java) with the TouchImageView class:
And finally, make the call in your main activity:
I saw lots of code and after my adjustments it's working. Enjoy!
I needed something similar, but needed the ability to get the dimensions easily and also drag/drop. I based this off of the answer @Nicolas Tyler gave and modified it from there.
The features are pinch zoom in/out, long press to vibration/highlighted drag/drop.
To use it add this CustomZoomView class to your project.
...then add this to your activity
...and this in your view in xml.
...and add this to your manifest
This is yet another implementation based on the code posted by Nicolas Tyler.
The following bugs are fixed:
minScale
to a number less than 1 now workssetImageBitmap()
to set the image (you can use, for examplesetImageResource()
The following things, amongst others are tidied up:
An
OnTouchListener
is not used, it's not necessary because the the class can just implement theonTouchEvent()
method.The assignment
right = width * saveScale - width - (2 * redundantXSpace * saveScale);
has been simplified toright = (originalBitmapWidth * saveScale) - width
Which, in my option, is much less confusing.It's not perfect but here you go:
Try the following:
Please follow the below class, that is used for Zoom in and Zoom Out for ImageView.