生成画布图片失败!
-
当前 Bug 的表现(可附上截图)
-
预期表现
-
复现路径
-
提供一个最简复现 Demo
wx.canvasToTempFilePath({ x: 0, y: 0, width: 600, height: 950, destWidth: posterWidth * 4, destHeight: posterHeight * 4, canvasId: 'shareImgOne', success: function (res) { console.log(res.tempFilePath); that.setData({ shareImgSrc: res.tempFilePath }) //wx.saveImageToPhotosAlbum将图片保存到本地 3 wx.saveImageToPhotosAlbum({ filePath: that.data.shareImgSrc, success(res) { wx.hideLoading(); wx.showModal({ title: '存图成功', content: '图片成功保存到相册了,去发圈噻~', showCancel: false, confirmText: '好哒', confirmColor: '#72B9C3', success: function (res) { if (res.confirm) { that.setData({ bigModel: false }) console.log('用户点击确定'); } } }) } }) }, fail: function (res) { console.log(res); that.setData({ bigModel: false }) } }); |
总是提示canvasToTempFilePath:fail:create bitmap failed,搞不懂啥原因
posterWidth
posterHeight
这两个是屏幕的宽高
