使用canvas导出图片,调用微信的分享api出现了发给好友图片出现红色感叹号,在鸿蒙系统6的微信中100%复现了。其他机型没有任何问题。可以正常保存到相册。
代码如下:
<canvas class="cvs" id="cvs" type="2d"></canvas>
wx.canvasToTempFilePath({
canvas: canvasNode,
success: (res) => {
console.log("res.tempFilePath", res.tempFilePath)
wx.showShareImageMenu({
path: res.tempFilePath,
})
},
fail: (error) => {
wx.showToast({
title: '导出失败',
icon: 'none'
})
}
})
以下为截图信息:
