-
大小: 137KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-05-09
- 语言: 其他
- 标签: DSHOW DirectShow
资源简介
使用DShow进行摄像头采集预览,并可以随时拍照,其中有获取采集设备列表、获取设备支持分辨率等功能,希望对大家有用
代码片段和文件信息
// GetDeviceInfo.cpp : Defines the class behaviors for the application.
//
#include “stdafx.h“
#include “GetDeviceInfo.h“
#include “GetDeviceInfoDlg.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CGetDeviceInfoApp
BEGIN_MESSAGE_MAP(CGetDeviceInfoApp CWinApp)
ON_COMMAND(ID_HELP &CWinApp::onhelp)
END_MESSAGE_MAP()
// CGetDeviceInfoApp construction
CGetDeviceInfoApp::CGetDeviceInfoApp()
{
// support Restart Manager
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
// TODO: add construction code here
// Place all significant initialization in InitInstance
}
// The one and only CGetDeviceInfoApp object
CGetDeviceInfoApp theApp;
// CGetDeviceInfoApp initialization
BOOL CGetDeviceInfoApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
AfxEnableControlContainer();
// Create the shell manager in case the dialog contains
// any shell tree view or shell list view controls.
CShellManager *pShellManager = new CShellManager;
// Activate “Windows Native“ visual manager for enabling themes in MFC controls
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T(“Local AppWizard-Generated Applications“));
CGetDeviceInfoDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
else if (nResponse == -1)
{
TRACE(traceAppMsg 0 “Warning: dialog creation failed so application is terminating unexpectedly.\n“);
TRACE(traceAppMsg 0 “Warning: if you are using MFC controls on the dialog you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS.\n“);
}
// Delete the shell manager created above.
if (pShellManager != NULL)
{
delete pShellManager;
}
// Since the dialog has been closed return FALSE so that we exit the
// application rather than start the application‘s message pump.
return FALSE;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 110020 2017-02-10 11:24 CameraTakePic\GetDeviceInfo.aps
文件 3006 2017-02-09 15:31 CameraTakePic\GetDeviceInfo.cpp
文件 547 2017-02-09 15:31 CameraTakePic\GetDeviceInfo.h
文件 13562 2017-02-10 11:24 CameraTakePic\GetDeviceInfo.rc
文件 892 2017-02-09 15:32 CameraTakePic\GetDeviceInfo.sln
..A..H. 30720 2017-02-10 11:29 CameraTakePic\GetDeviceInfo.v11.suo
文件 6442 2017-02-09 15:42 CameraTakePic\GetDeviceInfo.vcxproj
文件 2132 2017-02-09 15:31 CameraTakePic\GetDeviceInfo.vcxproj.filters
文件 23951 2017-02-10 11:27 CameraTakePic\GetDeviceInfoDlg.cpp
文件 3302 2017-02-10 11:14 CameraTakePic\GetDeviceInfoDlg.h
文件 4768 2017-02-09 15:31 CameraTakePic\ReadMe.txt
文件 67777 2013-06-05 10:20 CameraTakePic\res\GetDeviceInfo.ico
文件 810 2017-02-09 15:31 CameraTakePic\res\GetDeviceInfo.rc2
文件 2292 2017-02-10 11:07 CameraTakePic\resource.h
文件 215 2017-02-09 15:31 CameraTakePic\stdafx.cpp
文件 2215 2017-02-09 17:19 CameraTakePic\stdafx.h
文件 314 2017-02-09 15:31 CameraTakePic\targetver.h
目录 0 2017-02-10 09:20 CameraTakePic\res
目录 0 2017-02-10 11:29 CameraTakePic
----------- --------- ---------- ----- ----
272965 19
- 上一篇:net-snmp开始教程
- 下一篇:stm32 ADC四路采集代码,附解析
评论
共有 条评论