a629769192 | ||
---|---|---|
android | ||
example | ||
ios/lib | ||
src | ||
.flowconfig | ||
.gitignore | ||
.npmignore | ||
.watchmanconfig | ||
LICENSE | ||
README.md | ||
index.android.js | ||
index.ios.js | ||
package.json |
README.md
react-native-camera-kit
Currently work in progress.
Native camera control.
Install
Install using npm:
npm install react-native-camera-kit --save
- Locate the module lib folder in your node modules:
PROJECT_DIR/node_modules/react-native-camera-kit/lib
- Drag the
ReactNativeCameraKit.xcodeproj
project file into your project - Add
libReactNativeCameraKit.a
to all your target Linked Frameworks and Libraries (prone to be forgotten)
Examples
###CameraKitCamera
<CameraKitCamera
ref={(cam) => {
this.camera = cam;
}} // should be only if u want to make some actions in this specific camera instance
style={{flex: 1, justifyContent: 'flex-end'}}
cameraOptions={{
flashMode: 'auto',
focusMode: 'on',
zoomMode: 'on'
}}
/>
####capture Capture image
const image = await this.camera.capture(true);
####setFlashMode
Set flesh mode (auto
/on
/off
)
const success = await this.camera.setFlashMode(newFlashData.mode);
####changeCamera
Change to fornt/rear camera
const success = await this.camera.changeCamera();
###CameraKitGalleryView
<CameraKitGalleryView
ref={(gallery) => {
this.gallery = gallery;
}}
style={{flex: 1, marginTop: 20}}
minimumInteritemSpacing={10}
minimumLineSpacing={10}
albumName={<ALBUM_NAME>}
columnCount={3}
onSelected={(result) => {
//result.nativeEvent.selected - ALL selected images Photos Framework ids
}}
selectedImage={require('<IMAGE_FILE_PATH>')}
unSelectedImage={require('<IMAGE_FILE_PATH>')}
/>