Android: How to Convert Whole Imageview to Bitmap

Android: how to convert whole ImageView to Bitmap?

Have you tried:

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

GetBitmap from ImageView

Try this, hope it helps

ImageView imageView = findViewById(R.id.image);
BitmapDrawable bd = (BitmapDrawable) imageView.getDrawable();
Bitmap b = bd.getBitmap();

How to convert a Drawable to a Bitmap?

This converts a BitmapDrawable to a Bitmap.

Drawable d = ImagesArrayList.get(0);  
Bitmap bitmap = ((BitmapDrawable)d).getBitmap();

How to convert Views to bitmaps?

How to convert View into Bitmap

FrameLayout view = (FrameLayout)findViewById(R.id.framelayout);

view.setDrawingCacheEnabled(true);

view.buildDrawingCache();

Bitmap bm = view.getDrawingCache();


Related Topics



Leave a reply



Submit