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

📄 dialogoutputsetting.cpp

📁 利用web camera对目标进行特征跟踪的程序 对于初学机器视觉的有些帮助
💻 CPP
字号:
// DialogOutputSetting.cpp : implementation file
//

#include "stdafx.h"
#include "图像特征跟踪系统.h"
#include "DialogOutputSetting.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDialogOutputSetting property page

IMPLEMENT_DYNCREATE(CDialogOutputSetting, CPropertyPage)

CDialogOutputSetting::CDialogOutputSetting() : CPropertyPage(CDialogOutputSetting::IDD)
{
	//{{AFX_DATA_INIT(CDialogOutputSetting)
	m_bOutputResultImage = FALSE;
	m_nOutputTargetImage = FALSE;
	m_strOutputResultImageFilePath = _T("e:\\result00000.bmp");
	m_strOutputTargetImageFilePath = _T("e:\\target00000.bmp");
	//}}AFX_DATA_INIT
}

CDialogOutputSetting::~CDialogOutputSetting()
{
}

void CDialogOutputSetting::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialogOutputSetting)
	DDX_Check(pDX, IDC_CHECK_OUTPUT_RESULT_IMAGE, m_bOutputResultImage);
	DDX_Check(pDX, IDC_CHECK_OUTPUT_TARGET_IMAGE, m_nOutputTargetImage);
	DDX_Text(pDX, IDC_EDIT_RESULT_IMAGE_FILEPATH, m_strOutputResultImageFilePath);
	DDX_Text(pDX, IDC_EDIT_TARGET_IMAGE_FILEPATH, m_strOutputTargetImageFilePath);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDialogOutputSetting, CPropertyPage)
	//{{AFX_MSG_MAP(CDialogOutputSetting)
	ON_BN_CLICKED(IDC_BUTTON_BROWSE_TARGET_FILEPATH, OnButtonBrowseTargetFilepath)
	ON_BN_CLICKED(IDC_BUTTON_BROWSE_RESULT_FILEPATH, OnButtonBrowseResultFilepath)
	ON_BN_CLICKED(IDC_CHECK_OUTPUT_TARGET_IMAGE, OnCheckOutputTargetImage)
	ON_BN_CLICKED(IDC_CHECK_OUTPUT_RESULT_IMAGE, OnCheckOutputResultImage)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDialogOutputSetting message handlers
BOOL CDialogOutputSetting::OnSetActive() 
{
	// TODO: Add your specialized code here and/or call the base class
	CWnd* pWnd = this->GetDlgItem(IDC_EDIT_RESULT_IMAGE_FILEPATH);
	pWnd->EnableWindow(m_bOutputResultImage);
	pWnd = this->GetDlgItem(IDC_BUTTON_BROWSE_RESULT_FILEPATH);
	pWnd->EnableWindow(m_bOutputResultImage);
	pWnd = this->GetDlgItem(IDC_EDIT_TARGET_IMAGE_FILEPATH);
	pWnd->EnableWindow(m_nOutputTargetImage);
	pWnd = this->GetDlgItem(IDC_BUTTON_BROWSE_TARGET_FILEPATH);
	pWnd->EnableWindow(m_nOutputTargetImage);

	return CPropertyPage::OnSetActive();
}


void CDialogOutputSetting::OnButtonBrowseTargetFilepath() 
{
  	static char szFilter[] = "BMP文件(*.bmp)|*.bmp||";
	CFileDialog dlg(false,"bmp",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"BMP文件(*.bmp)|*.bmp||");
	if(dlg.DoModal() == IDOK)
	{
		m_strOutputTargetImageFilePath = dlg.GetPathName();
	}
	this->UpdateData(FALSE);
}

void CDialogOutputSetting::OnButtonBrowseResultFilepath() 
{
	static char szFilter[] = "BMP文件(*.bmp)|*.bmp||";
	CFileDialog dlg(false,"bmp",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"BMP文件(*.bmp)|*.bmp||");
	if(dlg.DoModal() == IDOK)
	{
		m_strOutputResultImageFilePath = dlg.GetPathName();
	}
	this->UpdateData(FALSE);
}

void CDialogOutputSetting::OnCheckOutputTargetImage() 
{
	this->UpdateData(true);
	CWnd* pWnd = this->GetDlgItem(IDC_EDIT_TARGET_IMAGE_FILEPATH);
	pWnd->EnableWindow(m_nOutputTargetImage);
	pWnd = this->GetDlgItem(IDC_BUTTON_BROWSE_TARGET_FILEPATH);
	pWnd->EnableWindow(m_nOutputTargetImage);
	pWnd->UpdateData(true);
}

void CDialogOutputSetting::OnCheckOutputResultImage() 
{
	this->UpdateData(true);
	CWnd* pWnd = this->GetDlgItem(IDC_EDIT_RESULT_IMAGE_FILEPATH);
	pWnd->EnableWindow(m_bOutputResultImage);
	pWnd = this->GetDlgItem(IDC_BUTTON_BROWSE_RESULT_FILEPATH);
	pWnd->EnableWindow(m_bOutputResultImage);
	pWnd->UpdateData(true);
}

⌨️ 快捷键说明

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