wx.canvasGetImageData 一个方法里边不能用两次?
发布于 6 年前 作者 yanliu 19865 次浏览 来自 问答

我想调取两个canvas上的图像信息合成一张canvas里边,在一个函数里边写两个 wx.canvasGetImageData方法,第一个可以输出结果,第二个什么也没有,fail的结果也没有任何输出,这是为什么?有没有别的方法合成两个canvas?

wx.canvasGetImageData({

canvasId: ‘faceCanvas’,

x: 0,

y: 0,

width: this.data.windowWidth,

height: this.data.windowWidth / this.data.bwh,

success:res=> {

console.log(res.data)

}

})

wx.canvasGetImageData({

canvasId: ‘bgCanvas’,

x: 0,

y: 0,

width: this.data.windowWidth,

height: this.data.windowWidth / this.data.bwh,

success: res => {

console.log(res.data)

},

fail(res){

console.log(res)

}

})

回到顶部