getImageData获取到图片数据后,再用putImageData画图,画出来的图片异常
[图片] 重要代码如下: 图片地址 https://oss.qipaistyle.com/3DImage/syst-em718H73870-72K18T71530-09-favorite.png
const query = wx.createSelectorQuery()
query.select('#canvas')
.fields({ node: true, size: true })
.exec((res) => {
const canvas = res[0].node
const ctx = canvas.getContext('2d')
ctx.drawImage(this.img, x, y, manWidth, manHeight)
ctx.restore()
var imageData = ctx.getImageData(0, 0, this.img.width, this.img.height);
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.putImageData(imageData, 0, 0);
}