// 建立canvas DOM元素,並設置其寬高和圖片同樣 var canvas = document.createElement("canvas"); canvas.width = image.width; canvas.height = image.height; // 座標(0,0) 表示今後處開始繪製,至關於偏移。 canvas.getContext("2d").drawImage(image, 0, 0); console.log(canvas); image.src =canvas.toDataURL(); //var imageSrc=canvas.toDataURL("image/png");
繪製和模仿圖片html
問題1:Tainted canvases may not be exported. ORS與Canvas圖片toDataURL https://www.web-tinker.com/article/20687.htmlweb