wx.canvasToTempFilePath 客户端获取到的图片被裁剪了?
发布于 5 年前 作者 xiulan89 3982 次浏览 来自 官方Issues

手机和开发工具上正常

微信客户端上就变成这样了

4 回复

PC端这种问题好像3.0版本以后就这样已经几个月了,大多小程序都懒得管PC端,所以很少人提这个问题。

请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

画板大小没设置好,看看是不是漏了dip

是不是屏幕分辨率的原因

let _this = this

		uni.canvasToTempFilePath({

			canvasId: \_this.CanvasID,

			quality: 1,

			complete: (res) => {

				console.log(res)

				console.log(res.tempFilePath);

				uni.setStorageSync('poster',res.tempFilePath)

				\_this.$emit('success',res);

			},

			fail(err) {

				// 失败重复调用

				\_this.getNewImage()

				console.log('err',err);

				errs(err);

			}

		},this);

这样试试行不行

回到顶部