VC6.0視頻采集的步驟:
1、插入攝像頭,安裝驅動 VCap2800 USB2.0 DRV(windows 7)或者Vcap2820 sdk,兩者依次嘗試





注意:驅動有一下幾種,如果USB2.0 DRVB不成功!!可以換驅動VCap2820 sdk進行嘗試!!!


2、G:\VC++視頻采集資料\USB2800\Vcap2820 sdk\Vcap2820 sdk目錄下的 devwdm.ax 放到c:\windows\system32\目錄下

3、打開 “運行”,輸入 Regsvr32 c:\windows\system32\devwdm.ax 進行注冊驅動


4、創建VC工程,基于對話框




5、添加devwdm.dll devwdm.h devwdm.lib到項目中,這些是攝像頭的相關API

5、在StdAfx.h文件中加載動態鏈接庫
#pragma comment(lib,"devwdm.lib")
- // stdafx.h : include file for standard system include files,
- // or project specific include files that are used frequently, but
- // are changed infrequently
- //
-
- #if !defined(AFX_STDAFX_H__1357FC0D_0191_4DD3_8CB5_4A15DA0B970C__INCLUDED_)
- #define AFX_STDAFX_H__1357FC0D_0191_4DD3_8CB5_4A15DA0B970C__INCLUDED_
-
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
-
- #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-
- #include <afxwin.h> // MFC core and standard components
- #include <afxext.h> // MFC extensions
- #include <afxdisp.h> // MFC Automation classes
- #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
- #ifndef _AFX_NO_AFXCMN_SUPPORT
- #include <afxcmn.h> // MFC support for Windows Common Controls
- #endif // _AFX_NO_AFXCMN_SUPPORT
-
- //注冊動態鏈接庫
- #pragma comment(lib,"devwdm.lib")
-
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
- #endif // !defined(AFX_STDAFX_H__1357FC0D_0191_4DD3_8CB5_4A15DA0B970C__INCLUDED_)
6、添加頭文件到響應的cpp應用文件中,進行測試
- void CVideoDemoDlg::OnOK()
- {
- // TODO: Add extra validation here
-
- devwdm_InitCard(0,m_static.m_hWnd,300,400);//初始化
-
- devwdm_StartVideoPreview(0);//啟動
-
- // CDialog::OnOK();
- }
備注:相關資料下載http://download.csdn.net/detail/ma451152002/6334637
轉載自: http://blog.csdn.net/ma451152002/article/details/12138343
posted on 2016-04-24 22:57
cpsprogramer 閱讀(1884)
評論(1) 編輯 收藏 引用 所屬分類:
VC++