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();
},
域名配置好了,图片是加载完成才绘制的
求大神帮我解答一下!!!!!!!!!!!!!!!!!
小程序简单绘图,通过 json 方式绘制一张朋友圈分享图 楼主了解一下✨ ✨
https://github.com/AfanSama/esay-canvas
麻烦给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),我们定位下问题