Android how to get bounds of imageview with matrix
I have an ImageView with scaletype set to matrix, and would like to get a Rect with the bounds of the image after the transformation of the matrix. How do I get such a rect? thanks. ImageView imageView = (ImageView)findViewById(R.id.imageview); Drawable drawable = imageView.getDrawable(); Rect imageBounds = drawable.getBounds(); Then use Matrix.mapRect. 来源: https://stackoverflow.com/questions/8590693/android-how-to-get-bounds-of-imageview-with-matrix