1. 程式人生 > >VC++視訊採集的步驟

VC++視訊採集的步驟

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")

  1. // stdafx.h : include file for standard system include files,  
  2. //  or project specific include files that are used frequently, but  
  3. //      are changed infrequently  
  4. //  
  5. #if !defined(AFX_STDAFX_H__1357FC0D_0191_4DD3_8CB5_4A15DA0B970C__INCLUDED_)  
  6. #define AFX_STDAFX_H__1357FC0D_0191_4DD3_8CB5_4A15DA0B970C__INCLUDED_  
  7. #if _MSC_VER > 1000  
  8. #pragma once  
  9. #endif // _MSC_VER > 1000  
  10. #define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers  
  11. #include <afxwin.h>         // MFC core and standard components  
  12. #include <afxext.h>         // MFC extensions  
  13. #include <afxdisp.h>        // MFC Automation classes  
  14. #include <afxdtctl.h>     // MFC support for Internet Explorer 4 Common Controls  
  15. #ifndef _AFX_NO_AFXCMN_SUPPORT  
  16. #include <afxcmn.h>           // MFC support for Windows Common Controls  
  17. #endif // _AFX_NO_AFXCMN_SUPPORT  
  18. //註冊動態連結庫  
  19. #pragma comment(lib,"devwdm.lib")  
  20. //{{AFX_INSERT_LOCATION}}  
  21. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.  
  22. #endif // !defined(AFX_STDAFX_H__1357FC0D_0191_4DD3_8CB5_4A15DA0B970C__INCLUDED_)  


6、新增標頭檔案到響應的cpp應用檔案中,進行測試

  1. #include "devwdm.h"  
  1. void CVideoDemoDlg::OnOK()   
  2. {  
  3.     // TODO: Add extra validation here  
  4.     devwdm_InitCard(0,m_static.m_hWnd,300,400);//初始化  
  5.     devwdm_StartVideoPreview(0);//啟動  
  6. //  CDialog::OnOK();  
  7. }  
posted on 2016-04-24 22:57 cpsprogramer 閱讀(1146) 評論(1)  編輯 收藏 引用 所屬分類: VC++