canvas.toTempFilePath(
发布于 6 年前 作者 qiaojie 15284 次浏览 来自 问答
  • 当前 Bug 的表现

canvas.toTempFilePath({

           x: 0,

           y: 0,

           width: 100,

           height: 100,

           destWidth: 100,

           destHeight: 100,

           success: function (res) {

               const fs = wx.getFileSystemManager();

               fs.saveFile({

                   tempFilePath: res.tempFilePath,

                   success: function (suc_res) {

                       cc.log(suc_res)

                   },

                   fail: function (fail_res) {

                       cc.log(fail_res)

                   }

               })

           }

       })

  • 预期表现

   截图,并保存

  • 复现路径

   toTempFilePath成功后,saveFile 会fail ,提示文件not found,必现

1 回复

 wx.getFileSystemManager(); 这个是你独创的方法么?微信都没这个API

直接用wx.saveFile不就行了么?

上个res里面出来的tempPath是个数组。。你得取【0】才有值

回到顶部