How to save HTML5 canvas?

后端 未结 4 408
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-01 09:30

Currently I am using Canvas2Image to save the content of my HTML5 canvas. It doesn\'t appear to work in Google Chrome, however. Any ideas on how to work around the issue are wel

4条回答
  •  庸人自扰
    2021-02-01 09:54

    var canvas = document.getElementById("canvas");
    var context = canvas.getContext("2d");
    var strDataURI = canvas.toDataURL("image/png;base64");
    document.write('');
    

提交回复
热议问题