wx.canvasToTempFilePath 返回的图片大小问题和bug
const ctx = wx.createCanvasContext( 'editorCanvas' ) ctx.drawImage(originalImagePath, 0, 0, imageWidthPx, imageHeightPx) ctx.draw() wx.canvasToTempFilePath({ canvasId: 'editorCanvas' , success: function (res) { console.log( "tempFilePath" ,res.tempFilePath) wx.getImageInfo({ src: res.tempFilePath, success: function (res) { console.log( "cut imagesize:" ,res.width,res.height,res) } }) |
1,canvasToTempFilePath返回的图片既不是editorCanvas大小,也不是drawImage大小
2,选择图片,第一次drawImage后wx.canvasToTempFilePath没问题;第二次选择图片后,wx.canvasToTempFilePath模拟器上出bug