I tried to get Bitmap attached to an ImageView, using ImageView.getDrawingCache();
But I found that the returned Bitmap was not the same as I\'d like to get from th
If your drawble is not always an instanceof BitmapDrawable
Note: ImageView should be set before you do this.
Bitmap bitmap;
if (mImageView.getDrawable() instanceof BitmapDrawable) {
bitmap = ((BitmapDrawable) mImageView.getDrawable()).getBitmap();
} else {
Drawable d = mImageView.getDrawable();
bitmap = Bitmap.createBitmap(d.getIntrinsicWidth(), d.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
d.draw(canvas);
}
Your bitmap is stored in bitmap.
Voila!