wx.canvasGetImageData安卓机获取数据全是0
发布于 5 年前 作者 xiayu 6536 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)

   安卓机打印出的像素值全是0

  • 预期表现

    安卓机可以打印出正确像素值

  • 复现路径
  • 提供一个最简复现 Demo

 ctx.draw(false, () => {

      wx.canvasGetImageData({

        canvasId: ‘canvas’,

        x: 0,

        y: 0,

        width: 100,

        height: 120,

        success(res) {

          imageData = res

          console.log(res.data.length)

          for(let i=0; i<res.data.length; i++){

            console.log(res.data[i])

          }

        }

      })

    })

2 回复

提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

回到顶部