context.draw(true,function(){
setTimeout(function(){
uni.canvasToTempFilePath({
x: 0,
y: 0,
width: 1080,
height: 1920,
destWidth: 1080,
destHeight: 1920,
canvasId: 'share-img-canvas',
quality:1,
success: function(res) {
if(res.tempFilePath){
_this.genedShareImgSrc = res.tempFilePath;
_this.isShowGenedShareImg = true;
}else{
uni.showToast({
icon:"none",
title:"生成图片失败"
});
}
},
fail:function(err){
console.log("====fail====",err);
uni.showToast({
icon:"none",
title:"生成图片失败"+err
});
},
complete:function(e){
console.log("====canvasToTempFilePath complete====",e);
uni.hideLoading();
}
});
},2000);
});
- 发布:2020-05-14 09:13
- 更新:2020-05-18 18:40
- 阅读:747
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 10.14.5
HBuilderX类型: Alpha
HBuilderX版本号: 2.7.1
手机系统: iOS
手机系统版本号: iOS 13.4
手机厂商: 苹果
手机机型: iphone 7 plus
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
无
无
预期结果:
生成图片
生成图片
实际结果:
生成图片白屏
生成图片白屏
bug描述:
canvasToTempFilePath在iphone7 plus 13.3.1版本上生成的图片是白屏(上面选择的版本号为啥没有13.3这个版本),但是在iphone6 12.4.5上是正常的。安卓目前都要正常,还望官方帮忙看下。
注:有问题的iphone都开启了icloud存储,不知道这点有没有影响
爱吃鱼的靖哥哥 (作者)
哈哈哈,恭喜入坑
2020-05-18 16:15
a***@dingtalk.com
回复 爱吃鱼的靖哥哥: 我搞定了
2020-05-18 17:53
a***@dingtalk.com
我这边是跟要绘画的图片有关系,小程序及安卓中使用uni.getImageInfo获取图片信息即可,但IOS必须得uni.downloadFile
2020-05-18 17:55