gpt4 book ai didi

react-native - 在 native react 中将图像转换为 base64

转载 作者:行者123 更新时间:2023-12-03 23:52:41 31 4
gpt4 key购买 nike

如何在 react native 中将本 map 片转换为 base64 并上传到服务器,请帮助任何人解决此查询。我已经尝试使用谷歌上可用的名为 的库图像到 base64 下午。

最佳答案

使用博览会 API

import { ImageManipulator } from 'expo';

const response = await ImageManipulator.manipulateAsync("file to local path", [], { base64: true })
console.log('base64res' + JSON.stringify(response));

关于react-native - 在 native react 中将图像转换为 base64,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55141511/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com