91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

CVI對普通USB攝像頭的控制代碼,程序和代碼,很不錯的!值得學習

資源截圖

代碼片段和文件信息

/*****************************************************************
* ?*
*?基于LabWindows/CVI的攝像頭控制技術--實現屏幕截圖、錄像功能???*
* ?*
*?代碼參考自:http://blog.sina.com.cn/u/4b677075010006da ?*
* ?*
*?本人是菜鳥,如有不對的地方,請多指教! ?*
* ?*
******************************************************************/

#include?“windows.h“
#include?“avicap32.h“
#include?
#include?
#include?“cam.h“

#define?Control_enabled?0
#define?Control_disabled?1
//設置所需要攝像頭的常量
#define?WM_CAP_START?????????WM_USER????//開始
#define?WM_CAP_STOP?????????WM_CAP_START?+?68??//停止
#define?WM_CAP_DRIVER_CONNECT??????WM_CAP_START?+?10???//連接
#define?WM_CAP_DRIVER_DISCONNECT??????WM_CAP_START?+?11???//斷開
#define?WM_CAP_SAVEDIB????????WM_CAP_START?+?25
#define?WM_CAP_GRAB_frame???????WM_CAP_START?+?60
#define?WM_CAP_SEQUENCE????????WM_CAP_START?+?62
#define?WM_CAP_FILE_SET_CAPTURE_FILEA????WM_CAP_START?+?20?//保存至文件
#define?WM_CAP_SEQUENCE_NOFILE?????WM_CAP_START?+?63
#define?WM_CAP_SET_OVERLAY??????WM_CAP_START?+?51
#define?WM_CAP_SET_PREVIEW??????WM_CAP_START?+?50
#define?WM_CAP_SET_CALLBACK_VIDEOSTREAM????WM_CAP_START?+6
#define?WM_CAP_SET_CALLBACK_ERROR?????WM_CAP_START?+2
#define?WM_CAP_SET_CALLBACK_STATUSA????WM_CAP_START?+3
#define?WM_CAP_SET_CALLBACK_frame?????WM_CAP_START?+5
#define?WM_CAP_SET_SCALE??????WM_CAP_START+??53
#define?WM_CAP_SET_PREVIEWRATE?????WM_CAP_START+??52
#define?WM_CAP_COPYDIB??????WM_CAP_START?+?30??//復制圖片
//定義面板句柄
static?int?handle;
//定義攝像頭句柄
static?int?result;
static?int?panelHandle;
//定義CANVAS_TV初始位置
static?int?canvas_tv_x;
static?int?canvas_tv_y;
int?main(int?argc?char?*argv[])?{
????if?(InitCVIRTE(0?argv?0)?==?0)
????????return?-1;?/*?out?of?memory?*/
????if?((panelHandle?=?LoadPanel(0?“cam.uir“?PANEL))?????????return?-1;
????DisplayPanel(panelHandle);
????GetCtrlAttribute(panelHandle?PANEL_CANVAS_TV?ATTR_LEFT?&canvas_tv_x);?//重定位CANVAS_TV要用到
????GetCtrlAttribute(panelHandle?PANEL_CANVAS_TV?ATTR_TOP?&canvas_tv_y);
????//320*240制式
????SetCtrlAttribute(panelHandle?PANEL_CANVAS_TV?ATTR_WIDTH?320);
????SetCtrlAttribute(panelHandle?PANEL_CANVAS_TV?ATTR_HEIGHT?240);
????//重新定位
????SetCtrlAttribute(panelHandle?PANEL_CANVAS_TV?ATTR_LEFT?(592-320)/2+canvas_tv_x);
????SetCtrlAttribute(panelHandle?PANEL_CANVAS_TV?ATTR_TOP?(333-240)/2+canvas_tv_y);
????RunUserInterface();
????DiscardPanel(panelHandle);
????return?0;
}
//退出按鈕
int?CVICALLBACK?QuitCallback(int?panel?int?control?int?event
????????void?*callbackData?int?eventData1?int?eventData2)?{
????switch?(event)?{
????????case?EVENT_COMMIT:
????????????QuitUserInterface(0);
????????????break;
????}
????return?0;
}
//開始按鈕
int?CVICALLBACK?startCB(int?panel?int?control?int?event
????????void?*callbackData?int?eventData1?int?eventData2)?{
????int?width;
????int?height;
????int?top;
????int?left;
????switch?(event)?{
????????case?EVENT_COMMIT:

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????3091??2007-04-17?11:40??Capture.cws

?????文件???????3895??2007-04-17?11:34??Capture.prj

?????文件???????1213??2007-04-10?21:32??avicap32.h

?????文件???????2102??2007-04-10?16:23??avicap32.lib

?????文件???????2510??2007-04-17?11:39??cam.h

?????文件??????15428??2007-04-17?11:39??cam.uir

?????文件??????11718??2007-04-17?09:13??Capture.c

?????文件?????982134??2007-04-17?10:18??界面.bmp

-----------?---------??----------?-----??----

??????????????1022091????????????????????8


評論

共有 條評論