canvas type为2d时 怎么通过chooseImage获取图片?
旧代码可以直接将 res.tempFilePaths[0] 显示出来
wx.chooseImage({
count: 1,
success: (res) => {
canvas.drawImage(res.tempFilePaths[0],0,0,150,100);
canvas.draw()
},
})
canvas type为2d,img.src=res.tempFilePaths[0]无法显示,只能使用本地地址或者网络地址,这个要怎么解决?
let img=canvas.createImage;
img.src = '../../images/0.png';
img.onload = () => { ctx.drawImage(img,0,0,res[0].width,res[0].height); }