如何保存图像视图的视口位图? - Android

How do I save the viewport bitmap of an imageview? - Android

我只想在 ImageView 中保存图像 displayed/cropped 的位图。

当我调用它时,它 returns 整个位图:

Bitmap bitmap = ((BitmapDrawable) imageView.getDrawable()).getBitmap();

使用它从 ImageView 获取位图

imageView.buildDrawingCache();
Bitmap bmap = imageView.getDrawingCache();