can i export svg from bonsaijs to png

118 Views Asked by At

Using bonsaijs, is there a way to export the stage (or entire svg) to a png file ?

I saw an option for importing a svg, but couldn't find an easy way to export it. Any leads on this would be appreciated ?

1

There are 1 best solutions below

0
On

No, there isn't any API provided to export SVG to PNG.

Nevertheless you could either create your own exporter that draws the whole SVG context to a Canvas context and exports that as PNG or instead of storing a static image and losing all movie informations and interactivity you could possibly store the whole Bonsai-Script for that specific user.