Get the App
SLTechnology News&Howtos  ›  Development  › 

How to achieve the zooming effect of android Sina Weibo pictures

Shulou Source: shulou.com Published: 2022-06-01 02:50:31 09月22日 Update

< bmpWidth / 4 || scaleHeight * scale * bmpHeight >

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!

Tags: Picture scale effect Sina screen button learning event content at the same time object size monitor limit code resolution picture resource size instance is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Technology macOS vpn MariaDB