Saving context.getImageData to a sessionStorage with html5?

1k Views Asked by At

I try this, but I don't succeed. Is there a posibility to save that object or their values and then use it , e.g. for a redraw?

1

There are 1 best solutions below

0
On

Instead of saving the image data array (which is uncompressed), I would suggest using Canvas.toDataURL to get a base64-encoded PNG for the canvas, and saving that string.

Later, you can draw this data URL to your canvas.