drawImage' on 'CanvasRenderingContext2D?

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

Failed to execute ‘drawImage’ on ‘CanvasRenderingContext2D’: The provided value is not of type ‘(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)’

TypeError: Failed to execute ‘drawImage’ on ‘CanvasRenderingContext2D’: The provided value is not of type ‘(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)’

就是把一张图写入画布,然后把画布导出,百度了案例,怎么弄都不成功,社区的各位老师帮忙看看呀。

const ctx = wx.createCanvasContext('myCanvas')
          ctx.drawImage(imgs, 00)
          ctx.draw()
          setTimeout(function(){
              wx.canvasToTempFilePath({
                x0,
                y0,
                canvas'myCanvas',
                fileType'jpg',
                success(res) {
                  console.log(res)
                }
              })
          },500)
          this.basicsSteps()
        }
0 回复
暂无回复