wx.drawImage画出的图片空白
const ctx = wx.createCanvasContext(‘mycanvas’);
//绘制上传的图片(that.data.tempFilePaths的值是相册选择的临时路径)
ctx.drawImage(that.data.tempFilePaths, 0, 0, 600, that.data.height);
console.log(“生成临时图片之前:” + that.data.tempFilePaths)
let x = ‘’;
ctx.draw(false, wx.canvasToTempFilePath({
canvasId: ‘mycanvas’,
success: function (res) {
console.log(res)
that.setData({
tempSavePath: res.tempFilePath
});
}
}));
2 回复
你好,请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。