Is there a way to save a canvas element’s content to data such as binary? I’m looking to be able to redraw this data when needed.
Not really sure on how to go about it..
Thanks so much!!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should be able to save the image into a variable like so:
var imageVar = canvasObject.toDataURL();, and restore it again by callingcanvasObject.drawImage(imageVar);I haven’t tested it yet, but the spec says it should work.