我在我的应用程序上使用反应本机相机和覆盖图像。现在我想使用按钮截取该屏幕的屏幕截图。但是当我截取屏幕截图时,图像上仅显示叠加图像。我需要用相机视图捕获屏幕以及叠加图像。
return (
<Camera
ref={(cam) => {
this.camera = cam;
}}
style={styles.preview}
aspect={Camera.constants.Aspect.fill}
captureTarget={Camera.constants.CaptureTarget.disk}
>
<Image
style={{width: 400, height: 400}}
source={require('./image/shilpamela.png')}
/>
<TouchableHighlight
style={styles.capture}
//onPress={this.takePicture.bind(this)}
onPress={
() => {
captureScreen({
format: "jpg",
quality: 0.8
})
.then(
uri => {
CameraRollExtended.saveToCameraRoll({
uri: uri,
album: 'Name'
}, 'photo')
},
error => console.error("Oops, snapshot failed", error)
);
}
}
underlayColor="rgba(255, 255, 255, 0.5)"
>
<View>
<Image
style={{width: 60, height: 60}}
source={require('./image/cam_button.png')}
/>
</View>
</TouchableHighlight>
</Camera>
);
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)