2011-12-21 67 views

回答

10
ImageView imageView = (ImageView)findViewById(R.id.imageview); 
Drawable drawable = imageView.getDrawable(); 
Rect imageBounds = drawable.getBounds(); 

然后使用Matrix.mapRect。

+1

很好,谢谢! – saarraz1 2011-12-21 15:37:08

+0

很高兴我可以帮助:) – 2011-12-21 15:38:04

+0

因此,我的完整代码是 'Rect bounds = imageView.getDrawable()。getBounds(); RectF boundsF = new RectF(bounds); imageView.getImageMatrix()。mapRect(boundsF); boundsF.round(bounds);' 谢谢,它的工作,我终于修好了一个过渡! – charlag 2017-06-09 07:09:09