I came across the following - How to convert linearlayout to image .
It converts a linear layout to an image. What is it exactly doing?
Is it like I press a button and it saves the screenshot of the app screen as an Image?
Is that what is meant by converting a LinearLayout to Image?
Asked
Active
Viewed 55 times
-1

Amit wadhwa
- 31
- 1
- 5
-
that question has a link to a potential duplicate. clicking that link shows an [answer](https://stackoverflow.com/a/5776741/4729721) which explains exactly what it's doing (creating a jpeg of the view) https://stackoverflow.com/questions/5776684/how-can-i-convert-a-view-to-a-drawable – a_local_nobody Jan 08 '21 at 09:36
1 Answers
0
I think Android already convert view to Bitmap for show on screen. You can call view.getDrawingCache() and you can set on your imageview with bitmap.
Bitmap b = Bitmap.createBitmap(view.getDrawingCache());
bmImage.setImageBitmap(b);

Recep_dagli
- 44
- 5