用ctx.drawImage画线上图片在真机上显示不出来
用ctx.drawImage画线上图片在真机上显示不出来,在开发者工具可以看到;
wxml:
<canvas canvas-id=“myCanvas_A” style=“width: 500rpx;height: 500rpx;”/>
js:
const avatarUrl = ‘https://dhxy.res.netease.com/pc/zt/20171220114806/img/prize4_a713569.png’;
const ctx_A = wx.createCanvasContext(‘myCanvas_A’);
ctx_A.drawImage(avatarUrl, 0, 0,100, 100);