我看js 有 toDataURL 方法 但是 uniapp 通过 uni.createCanvasContext('canvas') 返回的 实例并没有这个方法 是对应 uni.canvasToTempFilePath 吗
为什么不百度
- 发布:2023-12-20 10:16
- 更新:2023-12-20 11:04
- 阅读:344
最佳回复
喜欢技术的前端 - QQ---445849201
是的,生成图片的文件
uni.canvasToTempFilePath({
x: 0,
y: 0,
width: 300,
height: 200,
destWidth: 300,
destHeight: 200,
canvasId: 'firstCanvas',
success: function(res) {
// 在H5平台下,tempFilePath 为 base64
console.log(res.tempFilePath)
}
})
为什么不百度 (作者)
好的 ,谢谢
2023-12-20 11:08