react-native-camera

Get recently clicked image from camera on image view in react-native

拥有回忆 提交于 2019-12-23 15:33:51
问题 I am implementing camera in my react native application. I want to show the recently captured image from that camera in a small image view on the same screen after click. But I am not getting how do I access the recently clicked image. Whenever any new image is clicked through phone it has been given a default random name, how do I refer it in image view's source?Please suggest me some way to do that. My code is class Incident extends Component { constructor(props) { super(props) this.state=

How can I add a border frame in the camera?

人走茶凉 提交于 2019-12-12 17:30:09
问题 I need to add a square frame in the middle of the viewfinder of the react native camera view. There is not information about it in the repository also. And questions there is not being answered also. 回答1: Which module you are using? react-native-camera or react-native-camera-kit ? If you using react-native-camera just put View (or Image ) inside Camera component, then add styles to vertically and horizontally align this view. Like this: const styles = { container: { flex: 1, }, camera: { flex

react native run android has an error. Cannot change dependencies of configuration ':packagename:androidApis' after it has been resolved error

主宰稳场 提交于 2019-12-11 17:15:28
问题 I have a React Native project with many libraries like React Native Fetch Blob, React Native Camera, etc. For run the project I clone my repository and install node modules so run react-native run command encounter below error: After hours of search and try, I can't solve the problem. after that, I remove React Native Fetch Blob from the project and run android again so a new error encounter for React Native Camera I think this error raise on my android configuration and doesn't have to React

Possible Unhandled Promise Rejection (id: 0): Error: Permission denied (while saving the image via “CameraRoll.saveToCameraRoll()”)

偶尔善良 提交于 2019-12-11 03:18:57
问题 ss from my debugger I am getting Permission denied when trying to save the image to the gallery via "CameraRoll.saveToCameraRoll()" from react native. my code is below==> takePicture = async function() { if (this.camera) { const data = await this.camera.takePictureAsync(); let saveResult = CameraRoll.saveToCameraRoll(data.uri); console.warn('takePicture ', saveResult); console.warn('picture url ', data.uri); } }; i have taken permissions from android manifest and ios by adding required codes.

React Native: Multiple previews of camera stream

落爺英雄遲暮 提交于 2019-12-11 01:06:23
问题 I've got an application in React Native to be developed in Android and iOS, in which I'd like to take the camera stream, make some processing, and render it multiple times. Imagine an app like Instagram, in which you can add filters to the camera live and it shows the applied filters with on live previews. It would be more or less the same. I need to get the camera stream and be able to show it on screen multiple times. I've tried react-native-camera, but it only lets me to get one instance

canOverrideExistingModule issue in react-native application

陌路散爱 提交于 2019-12-10 23:15:37
问题 Hello every one i tried to create an camera app with react-native-camera module when i tried to run this app on my device (android mobile) getting following error. Can any one please provide me solution for this ? 回答1: Go to file "MainApplication.java" (under .\android\app\src\main\java\com\projectName) Make sure that under getPackages() function you don't have duplicate lines (in my case I had "new RCTCameraPackage()" twice). Fix duplicate imports as well. 来源: https://stackoverflow.com

How to snap pictures using expo react native camera?

限于喜欢 提交于 2019-12-06 08:51:28
问题 I have just started using React Native with Expo so I am kind of confused. So, I have made a camera component which I imported in the main screen. Everything looks good. But I can't take pictures. I cannot click the snap icon and save the image. Is there a component that I missed? I have only posted the CameraComponent class below. Camera.js class CameraComponent extends Component { state = { hasCameraPermission: null, type: Camera.Constants.Type.back } async componentWillMount() { const {

Is it possible to get the binary data from an image in React-Native?

落爺英雄遲暮 提交于 2019-12-06 02:57:33
问题 I'm using react-native-camera and I'm having trouble getting the image as binary data in react-native . I need this to be able to upload images to our backend. The only thing I manage to get is uri's to the image and then maybe sending that as FormData to the server but that is not recommended as that would require some infrastructure change to our backend. Is there anyone that know a solution or some tips regarding this issue? Any thoughts or help is very much appreciated. 回答1: If you want

Is it possible to get the binary data from an image in React-Native?

蹲街弑〆低调 提交于 2019-12-04 06:45:02
I'm using react-native-camera and I'm having trouble getting the image as binary data in react-native . I need this to be able to upload images to our backend. The only thing I manage to get is uri's to the image and then maybe sending that as FormData to the server but that is not recommended as that would require some infrastructure change to our backend. Is there anyone that know a solution or some tips regarding this issue? Any thoughts or help is very much appreciated. If you want to get image as binary data from react-native-camera . I recommend to use react-native-fs to read uri Example

React-native-camera limit barcode scan area

一世执手 提交于 2019-12-04 04:25:52
问题 I am using the barcode scanner from react-native-camera and currently if I use it and there are multiple QR-codes closely on top of each other, I point my camera at one and it reads the code above it which is outside of the display on screen but within the cameras view. If however there is no QR-code above the one I want to scan, then it scans the correct one, so it seems like it always scans the top QR-code within the cameras view. Here's my question: Is there a way to limit the "scan area"