i've used the drawing canvas part in common code (desktop + web). havent saved to file though
m
Michael Paus
10/28/2024, 6:29 PM
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
Alex Styl
10/29/2024, 4:03 AM
fixed. what did u end up using?
m
Michael Paus
10/29/2024, 8:20 AM
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)