wx.canvasGetImageData()获取的像素点都是0
代码如下,我将拍到的照片输出到画布,目的是想获得图片的图像像素点数据,可是输出的data都是零,求解
this .ctx.takePhoto({ quality: 'high' , success: (res) => { const page = wx.createCanvasContext( 'idcard' ); page.drawImage(res.tempImagePath); page.draw( true ,wx.canvasGetImageData({ canvasId: 'idcard' , x: 0, y: 0, width: 300, height: 400, success: function (e) { console.log(e) } })); } }) |