Hey, can someone recommend a lib/approach to "Scre...
# compose
s
Hey, can someone recommend a lib/approach to "Screenshot" the contents of a Composable? I would need atleast Android, Desktop, WasmJs and Js support. The content of the composeable is a Layout which represents a Grid, the contents being a Text() with coloured background(at the moment) - I could draw this myself fairly easily in a Image Container, but maybe there is a more approachable way đŸ˜›
c
Not sure if it is available in CMP but at least in android you can use https://developer.android.com/develop/ui/compose/graphics/draw/modifiers#composable-to-bitmap
s
For multiplatform you can use
ImageComposeScene
.
a
@Rebecca Franks shared this on X the other day. she mentioned it works on desktop. not sure about the rest https://x.com/riggaroo/status/1782756190289535317
c
Yeah, that’s what my link is.
s
Thanks, I will have a look through this!
m
What's your use case here? Are you trying to capture screens during runtime of the real app, or are you trying to do snapshot testing to compare screens against previous versions?