Tim Nuwin
Tim Nuwin

Reputation: 2887

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

I only want to save the bitmap of the image being displayed/cropped in the ImageView.

When I call this, it returns the entire bitmap:

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

Upvotes: 0

Views: 151

Answers (1)

Mubashar Javed
Mubashar Javed

Reputation: 749

Use this to get the bitmap from ImageView

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

Upvotes: 1

Related Questions