wx-cardscanner
wx-cardscanner copied to clipboard
canvas转base64图片以后,图片镜像显示
代码如下,将canvas转成base64图片以后,得到的图片是镜像反转的,不是原图
qrcodeBase64Tools.draw(false, () => {
wepy.canvasGetImageData({
canvasId: 'qrcodeBase64Tools',
x: 0,
y: 0,
width: qrcodeRes.width,
height: qrcodeRes.height
}).then((res) => {
let pngData = upng.encode([res.data.buffer], res.width, res.height)
this.qrcodeBase64 = 'data:image/jpeg;base64,' + wepy.arrayBufferToBase64(pngData)
this.$apply()
})
})```