lesca-react-capture-button
v4.0.3
Published
get base64 image use local file.
Readme
Why use it?
get blob url image use local file or mobile camera.
Live Demo
Installation
npm install lesca-react-capture-button --saveUsage
import CaptureProvider, { DOMString } from 'lesca-react-capture-button';
render() {
return (
<CaptureProvider
type={DOMString.png}
compress={0.5}
maxWidth={500}
multiple={false}
onCapture={(data) => {
data.forEach(dat=>{
const { url } = dat;
console.log(url);
})
}}
>
<button>capture</button>
</CaptureProvider>
);
}
Development
props
| Properties | description | default | | :----------------------- | :---------------------------------------------------------------------------------------------: | ----------: | | onCapture:function | callback | void | | compress:float | image compress (0 - 1) | 0.7 | | maxWidth:int | image max width size | 1024 | | multiple:boolean | is image processing multiple ? | false | | type:string | type | 'image/png' |
Features
- maintain if necessary
