Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Bitmap attached to ImageView

Given

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

Is it possible to retrieve the bitmap?

like image 292
lemon Avatar asked Nov 29 '11 06:11

lemon


People also ask

How to get Image from ImageView to bitmap in android?

Bitmap bm=((BitmapDrawable)imageView. getDrawable()). getBitmap(); Try having the image in all drawable qualities folders (drawable-hdpi/drawable-ldpi etc.)

How to get Image using bitmap in android?

You can get Bitmap from Drawables via following code. ImageView image = (ImageView) findViewById(R. id. image); Bitmap b = BitmapFactory.

Can ImageView display video?

You can add ImageView and VideoView in RelativeLayout and set ImageView to invisible and VideoView to visible and vice-versa and you can play video on onClick.


1 Answers

Bitmap bitmap = ((BitmapDrawable)image.getDrawable()).getBitmap(); 
like image 62
Arslan Anwar Avatar answered Sep 28 '22 22:09

Arslan Anwar