简体   繁体   English

我可以从bonsaijs导出svg到png

[英]can i export svg from bonsaijs to png

Using bonsaijs, is there a way to export the stage (or entire svg) to a png file ? 使用bonsaijs,有没有办法将舞台(或整个svg)导出到png文件?

I saw an option for importing a svg, but couldn't find an easy way to export it. 我看到了导入svg的选项,但是找不到导出它的简便方法。 Any leads on this would be appreciated ? 任何线索,将不胜感激?

No, there isn't any API provided to export SVG to PNG. 不,没有提供任何将SVG导出到PNG的API。

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. 不过,您可以创建自己的导出器,将整个SVG上下文绘制到Canvas上下文中,然后将其导出为PNG,或者代替存储静态图像并丢失所有电影信息和交互性,还可以为该特定用户存储整个Bonsai脚本。 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM