# capture-image **Repository Path**: JoyTron/capture-image ## Basic Information - **Project Name**: capture-image - **Description**: 使用高拍仪的USB camera接口完成预览和抓拍。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-05-09 - **Last Updated**: 2022-05-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 抓拍工具 通过高拍仪的USB CAMERA通用接口完成预览和抓拍。第一步预览用image stream的方式完成 。 计划支持平台directshow/windows, avfoundation/macos。 ## 使用方法 ```js 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 安装 ```shell npm install git+http://dev.ligotop.com/zhangheng/capture-image.git ```