标签:tee doc wim get create http 跨域 ror 图片
var imgs = new Image();
imgs.crossOrigin = "Anonymous"; //注意存放顺序
imgs.src = "http://192.168.0.107/ZHCX/CGZSIMG/1.jpg";
imgs.onload = function () {
var canvas = document.createElement(‘canvas‘);
canvas.width = imgs.width;
canvas.height = imgs.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(imgs, 0, 0, imgs.width, imgs.height);
var img1 = new Image();
img1.src = canvas.toDataURL("image/png");
alert("s")
}
imgs.onerror = function () {
alert("error")
}
标签:tee doc wim get create http 跨域 ror 图片
原文地址:http://www.cnblogs.com/cxchen/p/7145009.html