收藏
回答

vivo 10 saveImageToPhotosAlbum 保存图片是黑的

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug saveImageToPhotosAlbum 微信安卓客户端 7.0.21 1.0.0

生成图片代码:

this.canvas.drawImage(

item.content, 

item.x, 

item.y, 

item.hasOwnProperty('width') ? item.width : this.width, 

item.hasOwnProperty('height') ? item.height : this.height

);

this.canvas.draw(false, setTimeout(() => {

setTimeout(() => {

uni.canvasToTempFilePath({

x: 0,

y: 0,

width: Number(this.width),

height: Number(this.height),

fileType: this.imgType,

canvasId: 'canvas',

success: (res) => {

this.$emit('canvasImage', res.tempFilePath);

},

fail: (res) => {

console.log(res);

},

complete: () => {

uni.hideLoading();

}

}, this);

}, 500);

}));

保存图片代码:

uni.saveImageToPhotosAlbum({

filePath: this.canvasUrl,

success: function () {

uni.showToast({

title: '图片保存成功'

})

}

})

正常保存图片是:

vivo 10 保存的图片是:

其他手机上面保存都是正常的 只是在vivo10 上面 会有这个问题

最后一次编辑于  2020-11-24
回答关注问题邀请回答
收藏

1 个回答

  • Cjiang
    Cjiang
    2020-11-24

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

    2020-11-24
    有用
    回复 3
    • 故里
      故里
      2020-11-25
      流程:小程序里面打开是没有问题,点击页面保存按钮 保存到相册里面的图片 是黑的 但是文字会显示
      机型:vivo x9
      微信版本号:7.0.21
      系统版本号:7.1.2
      代码片段:https://developers.weixin.qq.com/s/BQeUf7m67Tms
      2020-11-25
      回复
    • Cjiang
      Cjiang
      2020-11-25回复故里
      用这个机型saveImageToPhotosAlbum 保存其他图片看看呢?
      2020-11-25
      回复
    • 故里
      故里
      2020-11-25回复Cjiang
      额 我这边没有这个手机 这个是 客户那边 反馈过来的 你这边能帮忙测试一下么
      2020-11-25
      回复
登录 后发表内容
问题标签