各位大佬为什么我的 canvas 保存为图片后多了一部分透明填充?
// 保存canvas为图片
uni.canvasToTempFilePath({
x: this.border.left,
y: this.border.top,
width: this.border.width,
heght: this.border.width,
destWidth: this.border.width * this.systemInfo.pixelRatio,
destHeight: this.border.width * this.systemInfo.pixelRatio,
quality: 1,
canvasId: "background",
success: ({ tempFilePath }) => {
console.log("tempFilePath: ", tempFilePath);
this.src = tempFilePath;
},
});
如图所示:
我想要截取剪裁框的大小,倒是生成图片之后图片高度内多了一部分填充物,并把我的内容挤压了。