开发者

Save Dojox GFX Canvas as SVG

开发者 https://www.devze.com 2022-12-18 18:48 出处:网络
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 f开发者_JAVA百科ile (SVG, PNG, JPG, etc

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 f开发者_JAVA百科ile (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.


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号