Search code examples
htmlcanvaskineticjs

HTML5 canvas KineticJS drawing layer


How i can drawing and save it as a layer.

   Add jsfiddle example, but i need could i can drawing: http://jsfiddle.net/nieszka/Z7ABH

Solution

  • You can use layer.toJSON() to save the layer as string in the database.

    Check out: http://www.zeali.net/mirrors/html5canvastutorials/kineticjs/html5-canvas-save-stage-as-json-string-with-kineticjs/index.html

    To create the layer again, use Kinetic.Node.create().

    See also: http://www.zeali.net/mirrors/html5canvastutorials/kineticjs/html5-canvas-load-stage-with-json-string-with-kineticjs/index.html