Search code examples
androidimageviewandroid-bitmap

Get Bitmap attached to ImageView


Given

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

Is it possible to retrieve the bitmap?


Solution

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