Canvas drawImage using data URL
问题 I'll start with the script: function saveInstance() { _savedInstance = document.getElementById('canvasID').toDataURL(); } function restoreInstance() { ctx.drawImage(_savedInstance,0,0); } The purpose is to save an instance of the canvas and re-apply it later [Similar to how ctx.save() saves the style and transformations]. However, I got the error that says incompatible types (Uncaught Error: TYPE_MISMATCH_ERR: DOM Exception 17). Is there any canvas method that will allow me to use the data