将 Dojox GFX Canvas 保存为 SVG
有没有办法将 Dojox GFX 画布序列化为 SVG?
我正在寻找一种方法来保存我的 Dojox GFX 画布内容,该方法可以导出为图形文件(SVG、PNG、JPG 等),这样可以轻松保存或打印,而 SVG 似乎是最有可能的。
我找到了对函数 dojox.gfx.utils.toSvg 的引用,它看起来很完美:
http ://docs.dojocampus.org/dojox/gfx/utils/toSvg
但是这个函数在我的Dojo(1.1)实现中不存在,并且在Dojo Toolkit文档中没有提到,所以我不确定是否它存在。
谢谢。
Is there a way to serialize a Dojox GFX canvas as SVG?
I am looking for a way to save my Dojox GFX canvas contents in a way which can be exported as a graphics file (SVG, PNG, JPG, etc.) which could be easily saved or printed, and SVG seemed the most likely.
I found a reference to a function dojox.gfx.utils.toSvg, which looked perfect:
http://docs.dojocampus.org/dojox/gfx/utils/toSvg
But this function does not exist in my Dojo (1.1) implementation, and is not mentioned in the Dojo Toolkit documentation, so I am not sure if it exists.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它是1.4 中的新增内容。如果您有时间的话,很可能它可以向后移植到早期版本。
我不明白关于“Dojo Toolkit 文档中没有提到它,所以我不确定它是否存在”的部分 - 您自己提供了文档的链接。我很确定您可以在 /dojox/gfx/tests/ 中找到其使用示例
It is new in 1.4. Most probably it can be backported to earlier versions, if you have time on hands.
I didn't understand the part about "[it] is not mentioned in the Dojo Toolkit documentation, so I am not sure if it exists" — you gave the link to the documentation yourself. And I pretty sure you can find examples of its use in /dojox/gfx/tests/