<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()
}
}
})
封装好的东西 不香么? 😂
https://developers.weixin.qq.com/community/develop/doc/000048447844f80b9107d64ab51006
2.7.7以上都无效