wx.canvasToTempFilePath 客户端获取到的图片被裁剪了?

发布于 7 年前作者 xiulan894157 次浏览最后编辑 7 年前来自 issues

手机和开发工具上正常

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

4 回复
xiulanjia
xiulanjia1 楼4 年前

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

yong62
yong622 楼4 年前

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

dqiao
dqiao3 楼4 年前

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

tao22
tao224 楼4 年前

是不是屏幕分辨率的原因

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);

这样试试行不行