// 创建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");
绘制和模仿图片
问题1:Tainted canvases may not be exported. ORS与Canvas图片toDataURL https://www.web-tinker.com/article/20687.html