1***@qq.com
1***@qq.com
  • 发布:2022-09-29 18:07
  • 更新:2022-09-29 18:07
  • 阅读:385

【报Bug】uni.canvasToTempFilePath安卓图片空白

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: WIND10

HBuilderX类型: 正式

HBuilderX版本号: 3.6.4

手机系统: Android

手机系统版本号: Android 10

手机厂商: 华为

手机机型: PLAYT4

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

uni.canvasToTempFilePath({
x:0,
y:0,
width:280,
height:360,
destWidth: 280,
destHeight: 360,
fileType:'jpg',
canvasId: 'firstCanvas',
quality:1,
success: function(res) {
console.log(res.tempFilePath)
uni.saveImageToPhotosAlbum({
filePath:res.tempFilePath,
success: function (res) {
console.log(res.path);

                        }  
                    });   

                    }  
                })

操作步骤:

uni.canvasToTempFilePath({
destWidth: 280,
destHeight: 360,
fileType:'jpg',
canvasId: 'firstCanvas',
quality:1,
success: function(res) {
console.log(res.tempFilePath)
uni.saveImageToPhotosAlbum({
filePath:res.tempFilePath,
success: function (res) {
console.log(res.path);

                        }  
                    });   

                    }  
                })

预期结果:

uni.canvasToTempFilePath({
destWidth: 280,
destHeight: 360,
fileType:'jpg',
canvasId: 'firstCanvas',
quality:1,
success: function(res) {
console.log(res.tempFilePath)
uni.saveImageToPhotosAlbum({
filePath:res.tempFilePath,
success: function (res) {
console.log(res.path);

                        }  
                    });   

                    }  
                })

实际结果:

uni.canvasToTempFilePath({
destWidth: 280,
destHeight: 360,
fileType:'jpg',
canvasId: 'firstCanvas',
quality:1,
success: function(res) {
console.log(res.tempFilePath)
uni.saveImageToPhotosAlbum({
filePath:res.tempFilePath,
success: function (res) {
console.log(res.path);

                        }  
                    });   

                    }  
                })

bug描述:

uni.canvasToTempFilePath 保存> 图片空白 canvas显示正常
参数设置多总,一样空白

uni.canvasToTempFilePath({    
                    x:0,  
                    y:0,  
                    width:280,  
                    height:360,  
                    destWidth: 280,  
                    destHeight: 360,  
                    fileType:'jpg',  
                    canvasId: 'firstCanvas',  
                    quality:1,  
                    success: function(res) {                          
                        console.log(res.tempFilePath)  
                         uni.saveImageToPhotosAlbum({  
                            filePath:res.tempFilePath,  
                            success: function (res) {  
                                console.log(res.path);  

                            }  
                        });                                               

                        }  
                    })
2022-09-29 18:07 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复