Is there any replacement for `ImageComposeScene` t...
# compose-desktop
m
Is there any replacement for
ImageComposeScene
that also works in common code?
a
Not that I’m aware of.
a
@Michael Paus if u are trying to take photos of composables u can this: https://x.com/i/bookmarks/1826233203008434221?post_id=1782756190289535317
i've used the drawing canvas part in common code (desktop + web). havent saved to file though
m
Thanks, but I have switched to another solution now which also turns out to be 2x faster than using ImageComposeScene. (The link to x.com seems to be broken.)
a
fixed. what did u end up using?
m
The original idea was to use that to render a SVG painter to an image and store that as a PNG or other kind of image. This works but is not directly cross platform. I ended up extracting all the relevant parts from
Copy code
org.jetbrains.compose.resources.SvgPainter
into a one shot SVG image renderer and it turned out that after removing all the overhead from the previous solution, the rendering is almost exactly 2x faster than that for a complex SVG rendered to a 2000x2000 pixel image. (For Android I use a special solution based on com.caverock:androidsvg-aar)
👍🏻 1
👍 2
👍🏾 1