D
D
Dmitry Mushtat2013-01-09 21:36:43
JavaScript
Dmitry Mushtat, 2013-01-09 21:36:43

Saving paper.js result

Hello.

Please, tell me how you can save the canvas with figures drawn in paper.js, so that you can then draw them using the same library.

I mean the way to get the data in the canvas, and how to put it back there.

Please, if you have any leading questions, I will be happy to answer.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Mushtat, 2013-01-10
@Mushtat

I did not find canvas data serialization methods in the library. Existing solutions are self-written, and are often suitable for specific tasks. But a solution was found, albeit not so elegant.
I save canvas data in js as an image. I send it to the server, and then I give it to the client.
var canvas = document.getElementById("mycanvas");
var img = canvas.toDataURL("image/png");
document.write('<img src="'+img+'"/>');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question