当我在本地c盘中使用该文件时出现错误
(未捕获的SecurityError:无法执行' toDataURL' on ' HTMLCanvasElement':可能无法导出受污染的画布。) 网址没有产生错误
$(document).ready(function(){
init();
$("#reset").bind("mousedown",resetClick)
});
function init(){
stage = new createjs.Stage("myCanvas"); //get the canvas in the stage
my_map=new createjs.Bitmap('octopus_line.png'); //create the bitmap
my_map.y=0;
my_map.x=0;
stage.addChildAt(my_map,2);
}
function resetClick(){
img = new Image();
img.crossOrigin="Anonymous";
//generate the url using toDataURL
canvas=document.getElementsByTagName("canvas")[0];
url=canvas.toDataURL("image/png").replace("image/png","image/octet-stream");
img.src = url;
download(img.src,"filename.png")
}