Fetch the repository succeeded.
通过高拍仪的USB CAMERA通用接口完成预览和抓拍。第一步预览用image stream的方式完成 。
计划支持平台directshow/windows, avfoundation/macos。
var Capture = require('capture_image');
var capture = Capture();
capture.add_device('liangtian');
// 或者
var capture = Capture({device: 'liangtian'});
/**
* params:
* window: browser's global window
* document: browser's global document
* rotate_opt:
* {
* shot: left or right or null,
* preview: left or right or null,
* }
* shot: photo taken's rotate direction
* preview: preivewer image's rotate direction
*
*/
capture.open(window, document, rotate_opt); // 打开预览
capture.shot();// 抓拍
capture.close(); //关闭
/**
* params:
* device {name: 'dev_name', id: number}
* rotate_opt {'shot': left, 'preview': right}
*/
capture.switch({name: 'Doccamera', id: 2}, {'shot': 'right'});
capture.switch();
npm install git+http://dev.ligotop.com/zhangheng/capture-image.git
Sign in for post a comment
Comments ( 0 )