I would like to capture the UI emitted by Jetpack compose as a Bitmap. In XML this was done like this:
Basically takes a view as an input parameter and returns it as a Bitmap.
//take screenshot of the view added as an input argument
fun takeScreenShot(view: View) : Bitmap {
val bitmap = Bitmap.createBitmap(
view.width,
view.height,
Bitmap.Config.ARGB_8888
)
val canvas = Canvas(bitmap)
view.draw(canvas)
return bitmap
}
What is the equivalent of this in Jetpack compose?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…