Android – Get Bitmap attached to ImageView

androidandroid-bitmapimageview

Given

ImageView image = R.findViewById(R.id.imageView);
image.setImageBitmap(someBitmap);

Is it possible to retrieve the bitmap?

Best Answer

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