How to achieve the zooming effect of android Sina Weibo pictures
BmpWidth / 4 | | scaleWidth * scale * bmpWidth > displayWidth / 5 | | scaleHeight * scale * bmpHeight > displayHeight / 5) & & (zoomNumber==-1) {zoom.setIsZoomOutEnabled (false);} else {zoom.setIsZoomOutEnabled (true);} zoom.setIsZoomInEnabled (true); System.gc () } / * method * / private void big () {+ + zoomNumber; int bmpWidth = bmp.getWidth (); int bmpHeight = bmp.getHeight (); / * set the magnification ratio of the picture * / double scale = 1.25; / * calculate the scale to be enlarged this time * / scaleWidth = (float) (scaleWidth * scale) ScaleHeight = (float) (scaleHeight * scale); / * Bitmap object after generating reSize * / Matrix matrix = new Matrix (); matrix.postScale (scaleWidth, scaleHeight); Bitmap resizeBmp = Bitmap.createBitmap (bmp, 0,0, bmpWidth, bmpHeight, matrix, true); mImageView.setImageBitmap (resizeBmp) / * limit the magnification size * / if (scaleWidth * scale * bmpWidth > bmpWidth * 4 | | scaleHeight * scale * bmpHeight > bmpWidth * 4 | | scaleWidth * scale * bmpWidth > displayWidth * 5 | | scaleHeight * scale * bmpHeight > displayHeight * 5) {zoom.setIsZoomInEnabled (false);} else {zoom.setIsZoomInEnabled (true);} zoom.setIsZoomOutEnabled (true) System.gc ();}}
The layout file is as follows:
Thank you for reading, the above is the "android Sina Weibo picture zoom effect how to achieve" of the content, after the study of this article, I believe you on android Sina Weibo picture zoom effect how to achieve this problem have a deeper understanding, the specific use of the need for everyone to practice and verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!