收藏
回答

canvasToTempFilePath 回调不执行?

 //----------绘制图形并取出图片路径--------------

        var ctx = wx.createCanvasContext('canvas', that)

        ctx.drawImage(res.path, 0, 0, canvasWidth, canvasHeight)

        console.log(3344)

        ctx.draw(false, () => {

          //留一定的时间绘制canvas

          console.log(1100)

          setTimeout(() => {

            console.log(2222)

            wx.canvasToTempFilePath({

              canvasId: 'canvas',

              destWidth: canvasWidth,

              destHeight: canvasHeight,

              success:(res) => {

                console.log(1)

                console.log(res.tempFilePath//最终图片路径

              },

              fail: (res) => {

                console.log(2)

                console.log(res.errMsg)

              }

            }, that)

          }, 5000)

        })


回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签