Canvas绘制图片无效

发布于 7 年前作者 yonglong7314 次浏览最后编辑 7 年前来自 issues

<canvas type=“2d” style=“width: 300; height: 200;” canvas-id=“firstCanvas”></canvas>

let ctx = wx.createCanvasContext(‘firstCanvas’)

wx.downloadFile({

url: https://www.baidu.com/img/bd\_logo1.png,

success: res => {

console.log(res)

if (res.statusCode === 200) {

ctx.drawImage(res.tempFilePath, 10, 10, 150, 100)

ctx.draw()

}

}

})

2 回复
yangxie
yangxie2 楼5 年前

2.7.7以上都无效