Hi! I'm trying to copy element from one in my page to another (via javascript). It's successfully copied but appeared empty.
How to copy/move canvas with content?
Hi! I'm trying to copy element from one in my page to another (via javascript). It's successfully copied but appeared empty.
How to copy/move canvas with content?
I think the spec tells that a canvas is cleared when resized, I guess it is the same when cloned in the DOM too. So you need to get the image data with getImageData and put it back with putImageData
See here.