getImageInfo回调cavas不能绘图
<!–index.wxml–>
<view class=“container”>
<canvas canvas-id=“myCanvas_A” width=“375px” height=“288px” style=“width:375px;height:288px;border:1px solid coral;”/>
</view>
const ctx_A = wx.createCanvasContext(‘myCanvas_A’);
wx.getImageInfo({
src: ‘https://img.alicdn.com/imgextra/i4/759415648/O1CN01hlt9yS1rapSLhYmL1_!!759415648.jpg’,
success: function (res) {
console.log(res);
ctx_A.drawImage(res.path, 0, 0, res.width,res.height);
}
})
getImageInfo回调cavas不能绘图
4 回复