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

📄 dlgopenfile.cpp

📁 本程序采用Visual C++6.0对全色图像和多光谱遥感图像进行了基于相关系数的图像融合
💻 CPP
字号:
// DlgOpenFile.cpp : implementation file
//

#include "stdafx.h"
#include "pixelfusion.h"
#include "DlgOpenFile.h"

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

/////////////////////////////////////////////////////////////////////////////
// DlgOpenFile dialog


DlgOpenFile::DlgOpenFile(CWnd* pParent /*=NULL*/)
	: CDialog(DlgOpenFile::IDD, pParent)
{
	//{{AFX_DATA_INIT(DlgOpenFile)
	m_lpszMulspecPath = _T("");
	m_lpszSpotPath = _T("");
	binput=false;
	binput2=false;
	//}}AFX_DATA_INIT
}


void DlgOpenFile::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(DlgOpenFile)
	DDX_Text(pDX, IDC_lpszMulspecPath, m_lpszMulspecPath);
	DDX_Text(pDX, IDC_lpszSpotPath, m_lpszSpotPath);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(DlgOpenFile, CDialog)
	//{{AFX_MSG_MAP(DlgOpenFile)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// DlgOpenFile message handlers

void DlgOpenFile::OnButton1() 
{
	// TODO: Add your control notification handler code here
	// 文件对话框
	CFileDialog dlg(TRUE, "Bmp", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, 
		"BMP文件(*.bmp)|*.bmp|所有文件(*.*)|*.*||",NULL);
	if (dlg.DoModal() == IDCANCEL)
		return;

	m_lpszSpotPath = dlg.GetPathName();
	binput=true;
	UpdateData(FALSE);

	//m_lpszSpotPath = filename;
}

void DlgOpenFile::OnButton2() 
{
	// TODO: Add your control notification handler code here
	// 文件对话框
	CFileDialog dlg(TRUE, "Bmp", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, 
		"BMP文件(*.bmp)|*.bmp|所有文件(*.*)|*.*||",NULL);
	if (dlg.DoModal() == IDCANCEL)
		return;

	m_lpszMulspecPath = dlg.GetPathName();
	binput2=true;
	UpdateData(FALSE);
}

void DlgOpenFile::OnOK() 
{
	UpdateData(TRUE);
	if(!(binput&&binput2))
	{
		AfxMessageBox("请输入图像路径!");
		return;
	}
	CDialog::OnOK();
}

⌨️ 快捷键说明

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