wx-cardscanner icon indicating copy to clipboard operation
wx-cardscanner copied to clipboard

canvas转base64图片以后,图片镜像显示

Open codfishzhang opened this issue 6 years ago • 0 comments

代码如下,将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()
  })
})```

codfishzhang avatar Jun 19 '18 05:06 codfishzhang