个人案例
孕妈帮手
孕期工具查询
孕妈帮手扫码体验
去吐槽吧
我爱世界杯
我爱世界杯扫码体验
open邮箱账号:2305482077@qq.com2305
开放平台移动应用申请不通过,申请的应用名称与网站应用信息不一致?我的应用和官网信息一致,哪里不一致? app名称:心筑 应用描述:心筑,遇见、治愈你的心情 应用官网 https://lingting.woshimama.cn
2024-07-08奇怪的是偶尔会正常
canvasToTempFilePath图片变形?我用canvas载入图片: wx.createSelectorQuery().select('#myCanvas').fields({ node: true, size: true }).exec((res)=>{ const canvas = res[0].node that.canvas = canvas; that.context = canvas.getContext('2d') canvas.width = res[0].width * app.globalData.pixelRatio canvas.height = res[0].height * app.globalData.pixelRatio const img = canvas.createImage(); img.src = that.data.url; img.onload = () => { //计算图片和canvas的宽高比,对图片进行保持比例缩放。图片可正常按比例载入 that.context.drawImage(img, 0, 0, that.data.scaledWidth/**计算后的图片宽**/, that.data.scaledHeight/**计算后的图片高**/); } } confirmTap: function () { var that = this; wx.showLoading({ title: '正在保存图片', }) setTimeout(() => { wx.canvasToTempFilePath({ x: 0, y: 0, width: that.data.scaledWidth, height: that.data.scaledHeight, destWidth: that.data.scaledWidth * app.globalData.pixelRatio, /**app.globalData.pixelRatio为像素比**/ destHeight: that.data.scaledHeight * app.globalData.pixelRatio, // width: 10, // height: 10, // destHeight: 300, // destWidth: 300, fileType: 'jpg', canvas: this.canvas, success: function (res) { console.log(res); var tempFilePath = res.tempFilePath; console.log(tempFilePath); wx.saveImageToPhotosAlbum({ filePath: res.tempFilePath, success:function(res){ wx.hideLoading() } }) } }) }, 1500); } 但实际保存的图片是整个canvas的宽高,但被缩放成that.data.scaledWidth * app.globalData.pixelRatio和that.data.scaledHeight * app.globalData.pixelRatio 加载时的图片 [图片] 保存的图片 [图片]
2022-01-21使用新版canvas已解决
movable-view内嵌套canvas,但lineTo等画图功能在开发者工具可以,真机无效?手机安卓,基础库版本2.21.0。 <movable-area scale-area> <movable-view direction="none" bindchange="onChange" bindscale="onScale" scale scale-min="0.5" scale-max="10" scale-value="{{scale}}"> <canvas canvas-id="canvas" class="canvas" bindtouchstart='touchstart' bindtouchmove='touchmove'></canvas> </movable-view> </movable-area> 放大缩小是正常的,但是使用bindtouchstart和bindtouchmove画线的时候,开发者工具可以,真机没有线条。
2022-01-21