⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 propertydlg.cpp

📁 基于SDK的图像采集程序
💻 CPP
字号:
// PropertyDlg.cpp : implementation file
//

#include "stdafx.h"
#include "multicard.h"
#include "PropertyDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPropertyDlg dialog


CPropertyDlg::CPropertyDlg(int iCardID, CWnd* pParent /*=NULL*/)
	: CDialog(CPropertyDlg::IDD, pParent),
	m_iCardID(iCardID)
{
	//{{AFX_DATA_INIT(CPropertyDlg)
	m_id = -1;
	//}}AFX_DATA_INIT
}


void CPropertyDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPropertyDlg)
	DDX_Radio(pDX, IDC_RADIO1, m_id);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPropertyDlg, CDialog)
	//{{AFX_MSG_MAP(CPropertyDlg)
	ON_BN_CLICKED(IDC_DISPLAY_PROPERTY, OnDisplayProperty)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPropertyDlg message handlers

BOOL CPropertyDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

	char szCaption[20];
	sprintf(szCaption, "%d号卡: 枚举属性页", m_iCardID);
	SetWindowText(szCaption);
	
	// TODO: Add extra initialization here
	m_id = -1;

	BOOL bSupport;
	for(int i=11; i>=0; i--)
	{
		DSStream_IsPropertyExist(m_iCardID, (PropertyDialog)i, &bSupport);
		GetDlgItem(IDC_RADIO1+i)->EnableWindow(bSupport);
		if(bSupport)
			m_id = i;
	}
	UpdateData(FALSE);

	if(m_id==-1)
		GetDlgItem(IDC_DISPLAY_PROPERTY)->EnableWindow(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CPropertyDlg::OnDisplayProperty() 
{
	UpdateData();

	if(PropertyDlg_VideoPreviewPin == (PropertyDialog)m_id)
		DSStream_DisconnectPin(m_iCardID, PREVIEW);

	DSStream_DisplayPropertyDialogs(m_iCardID, (PropertyDialog)m_id, m_hWnd);

	if(PropertyDlg_VideoPreviewPin == (PropertyDialog)m_id)
		DSStream_ConnectPin(m_iCardID, PREVIEW);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -