/react-photogram

Takes a photo from web camera

Primary LanguageJavaScript

react-photogram

version

Screenshots

Using <WithThumbnailsBox /> HOC Simple <CameraView/>
inplace simple
Embedded to dialog
dialog

Installation

	npm install --save react-photogram

Importing

	import CameraView,{WithThumbnailsBox} from 'react-photogram'

<CameraView/>

Properties

Name type Description
cameraWidth int device resolution,translates into video width = cameraWidth,video height = cameraWidth * 0.75
livePreview bool fires onLinePreview(imageURL)
noLocalStorage bool saves the crop box to local storage
snapKeys array of strings maps a specefied keys to make a snaphot,like as KeyboadEvent.code like ['Space','Enter']
button:{
vAlign:"val",
hAlign:"val"
}
object{string,string} Snap button alignment,can be of middle,top,left,right,bottom for vAlign and hAlign
mute bool Disables the shutter sound
outputSize:{
width:num,
height:num
}
object{int,int} translates actual cropping size into that width and height

Methods

Name Description
onImage(imageObj) fires on button clicked/hotkey pressed
onLivePreview(dataURL) streaming cropped picture for preview

<WithThumbnailsBox/>

Properties

Extends <CameraView/> props with folowwing props:

Name type Description
thumbnailSize:{
width:num
height:num
thumbsPerLine:num
}
object(int,int,int) Sets thumbnails dimension,and thumbs per line on thumbnails box view