How to get a bitmap from ImageView

Asked 2 years ago, Updated 2 years ago, 178 views

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

How do I get a bitmap from the image view when given like this?

android imageview android-bitmap

2022-09-22 22:20

1 Answers

Bitmap bitmap = ((BitmapDrawable)image.getDrawable()).getBitmap(); You can do it in this way.


2022-09-22 22:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.