QQ小程序,使用uni.canvasToTempFilePath在指定区域时生成图片变形,如下
uni.canvasToTempFilePath({
x: 10,
y: 20,
width: 200,
height: 100,
canvasId: "canvasId",
fileType: "jpg",
quality: 0.8,
success: (res) => {
console.log( res);
},
fail: (error)=>{
console.log( error);
},
});
- 发布:2022-09-28 11:36
- 更新:2022-09-28 14:08
- 阅读:212
产品分类: uniapp/小程序/QQ
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 12.5.1
HBuilderX类型: 正式
HBuilderX版本号: 3.6.4
第三方开发者工具版本号: 20220922
基础库版本号: 1.56.0
项目创建方式: HBuilderX
示例代码:
操作步骤:
QQ小程序,使用uni.canvasToTempFilePath在指定区域时生成图片变形。
一定要指定x,y,width,height才会变形
QQ小程序,使用uni.canvasToTempFilePath在指定区域时生成图片变形。
一定要指定x,y,width,height才会变形
预期结果:
生成指定区域为正常图片
生成指定区域为正常图片
实际结果:
生成指定区域为变形图片,如附件图片。
生成指定区域为变形图片,如附件图片。
bug描述:
QQ小程序,使用uni.canvasToTempFilePath在指定区域时生成图片变形,如下
uni.canvasToTempFilePath({
x: 10,
y: 20,
width: 200,
height: 100,
canvasId: "canvasId",
fileType: "jpg",
quality: 0.8,
success: (res) => {
console.log( res);
},
fail: (error)=>{
console.log( error);
},
});
如果不指定区域,生成图片正常,如下代码:
uni.canvasToTempFilePath({
canvasId: "canvasId",
fileType: "jpg",
quality: 0.8,
success: (res) => {
console.log( res);
},
fail: (error)=>{
console.log( error);
},
});