- 保存canvas图片下边是黑的?
canvasToTempFilePath saveImageToPhotosAlbum drawImage(src) { let byclear = this.data.byclear; let ctx = wx.createCanvasContext('canvasPoster', this) ctx.drawImage(this.data.src, 0, 0, 601 * byclear, 809 * byclear) wx.getImageInfo({ src: src, success(res) { console.log(res); ctx.drawImage(res.path, 40 * byclear, 849 * byclear, 120 * byclear, 120 * byclear) } }) ctx.setFontSize(14) ctx.fillText('xxxx', 240 * byclear, 869 * byclear) ctx.setFontSize(12) ctx.setFillStyle('#ffdc06') ctx.setTextBaseline('bottom') ctx.fillText('长按保存图片分享', 240 * byclear, 949 * byclear) ctx.draw() }, createQRCode() { Api.UserApi.createQRCode({ page: 'pages/index/index', scene: '123' }).then(res => { const fsm = wx.getFileSystemManager(); const buffer = wx.base64ToArrayBuffer(res); const fileName = wx.env.USER_DATA_PATH + '/share_img.jpg' fsm.writeFileSync(fileName, buffer, 'binary') this.drawImage(fileName) }) }, saveImg() { wx.canvasToTempFilePath({ canvasId: 'canvasPoster', success: (res) => { wx.saveImageToPhotosAlbum({ filePath: res.tempFilePath, success: (result) => { wx.showToast({ title: '海报已保存,快去分享给好友吧。', icon: 'none' }) } }) }, fail(err) { console.log(err) } }, this) }, 远程图片canvas无法渲染 保存到相册下半部分黑色
2020-03-19 - define is not defined, wx is not defined?
1.02.2002202 1.02.1911180稳定版遇到这个问题,换到开发版还是有,会是我本地系统的问题吗?win10 [图片]
2020-02-24 - 可以增加 ctrl tab 切换文件功能吗?
RT wxml和wxss等情况切换的时候真的很不方便
2019-12-30 - 开发工具界面加载有问题?
更新到最新版还是这样[图片]
2019-12-29