I'm building an Android app in Kotlin, and I want to capture a particular View (like a TextView or ImageView) as a Bitmap. I’ve read that DrawingCache can help with this, but I’m unsure if it’s the best approach. I need the bitmap to save or share as an image later.
Here’s what I’ve tried so far:
- Enabled drawingCache for the view.
- Used Canvas to draw the view into a Bitmap.
I want to capture the view as a Bitmap so I can later save it as an image or share it.