本地canvas绘图后想转成图片,提示错误?跪求!

Failedtoexecute'toDataURL'on'HTMLCanvasElement':Taintedcanvasesmaynotbeexported
letoCanvas2=this.viewer.canvas.children[0];
this.mycanvas=document.createElement("canvas");
this.mycanvas.width=oCanvas2.width;
this.mycanvas.height=oCanvas2.height;
letdestCtx=oCanvas2.getContext('2d');
letimage=newImage();
image.crossOrigin="anonymous";
image.src=oCanvas2.toDataURL("image/png");
destCtx.drawImage(image,0,0);
请问这种应该怎么修改?
慕哥9229398
浏览 292回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript