canvas绘图的高度有限制吗?

发布于 7 年前作者 jun443801 次浏览最后编辑 7 年前来自 issues

使用canvas绘图,高度超过3500,超出3500的部分就没有了?这是怎么回事

使用ctx.draw()方法之后调用以下方法,获取图片临时路径,使用wx.previewImage()查看大图,图片展示不全

exportImg(idn, w, h) {
    let self = this
    wx.canvasToTempFilePath({
      x: 0,
      y: 0,
      width: w,
      height: h,
      destWidth: w,
      destHeight: h,
      canvasId: idn,
      success: function (res) {
        wx.getImageInfo({
          src: res.tempFilePath,
          success: function (res) {
            console.log(res.path)
            self.setData({
              card_url: res.path,
            })
          },
        })
      },
      fail(err) {
        console.error(err)
      },
      complete(res) { },
    })
  },
2 回复
fang38
fang381 楼6 年前

这里使用的是旧的canvas?可以了解一下新的canvas:https://developers.weixin.qq.com/community/develop/doc/00020a02c2c040114d19a398f5b001?blockType=1

yan05
yan052 楼5 年前

高度无限制啊