.. _dojox/gfx/utils/toJson: dojox.gfx.utils.toJson ====================== :Status: Contributed, Draft :Version: 1.4 :Author: Eugene Lazukin, Jared Jurkiewicz :Available: since V1.0 .. contents:: :depth: 2 The *dojox.gfx.utils.toJson* is a helper function designed to serialize a dojox.gfx.Surface object into a JSON representation for sa variety of scenarios, such as sending it across the wire to save, using it to copy a surface, and so on. The function itself is simple to use. ===== Usage ===== If you wish to use this function, then your code must do a *dojo.require("dojox.gfx.utils");* to load it. The function signature is: *dojox.gfx.utils.toJson(/*dojox.gfx.Surface*/ surface); So basic usage is: .. code-block :: javascript var json = dojox.gfx.utils.toJson(mySurface); Functional Exaple ----------------- .. cv-compound :: .. cv :: javascript .. cv :: html
Click me to serialize the GFX object to JSON!


JSON Serialization