Is there a suggested way of taking a screenshot (c...
# compose-android
j
Is there a suggested way of taking a screenshot (capturing into a bitmap) the contents of a Composable? Something like drawing into a custom Canvas/Bitmap in the View system?
Making using a custom drawing modifier (
drawWithCatch
,
drawWithContent
), and doing something along the lines of
Copy code
(DrawScope.) {
  it.nativeCanvas.setBitmap(customBitmap)?
}
m
https://developer.android.com/develop/ui/compose/graphics/draw/modifiers#composable-to-bitmap but requires using Compose 1.7 alpha 7 or later version Or do it the old way like what https://github.com/PatilShreyas/Capturable is currently doing if you're on Compose 1.6 or older version
K 1