【发布时间】:2020-12-13 11:16:44
【问题描述】:
我正在应用程序中的相机上工作,我在其中拍照并转换为 base64 现在我想显示图像但无法显示图像。有人可以帮助我如何实现这个目标。
谢谢
takePicture = async () => {
if (this.camera) {
let photo = await this.camera.takePictureAsync({
base64: true,
});
this.props.cameraToggle(false);
this.props.image(photo)
console.log('@@@ take picutre', photo)
}
}
我要渲染的图像代码
<Image source={{uri:`data:image/png;base64,${cameraImage}`}} style={{width:100,height:100}}/>
【问题讨论】:
标签: javascript reactjs react-native ecmascript-6 expo