drawImage 绘制图像到画布,在真机上怎么显示不了
imageOnLoad(ev) {
console.log(ev);
var _this = this;
//放大镜效果
var bannerUrl = _this.data.url_com + _this.data.bannerUrl;
var wImg = ev.detail.width;
var hImg = ev.detail.height;
var width = parseFloat(_this.data.width);
console.log(bannerUrl);
console.log(wImg);
console.log(hImg);
console.log(width);
var ctx = wx.createCanvasContext(‘myCanvas’);
ctx.drawImage(bannerUrl, 0, 0, wImg, hImg, 0, 0, width, width);
ctx.draw();
},
域名配置好了,图片是加载完成才绘制的
求大神帮我解答一下!!!!!!!!!!!!!!!!!
2 回复