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

📄 cutdlg.cpp

📁 图像处理软件,功能比较基础
💻 CPP
字号:
// CutDlg.cpp : implementation file
//

#include "stdafx.h"
#include "linjunjuan.h"
#include "CutDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCutDlg dialog


CCutDlg::CCutDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CCutDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCutDlg)
	m_dimpath = _T("");
	m_refpath = _T("");
	m_sarpath = _T("");
	m_picnum = 50;
	m_dim_c_path = _T("");
	m_ref_c_path = _T("");
	m_sar_c_path = _T("");
	m_moni_path = _T("");
	m_firstnum = 1;
	m_txtpath = _T("");
	//}}AFX_DATA_INIT
}


void CCutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCutDlg)
	DDX_Control(pDX, IDC_PLACE, m_place);
	DDX_Control(pDX, IDC_COMBO_HEIGHT, m_height);
	DDX_Text(pDX, IDC_DIM_PATH, m_dimpath);
	DDX_Text(pDX, IDC_REF_PATH, m_refpath);
	DDX_Text(pDX, IDC_SAR_PATH, m_sarpath);
	DDX_Text(pDX, IDC_PICNUM, m_picnum);
	DDX_Text(pDX, IDC_DIM_C_PATH, m_dim_c_path);
	DDX_Text(pDX, IDC_REF_C_PATH, m_ref_c_path);
	DDX_Text(pDX, IDC_SAR_C_PATH, m_sar_c_path);
	DDX_Text(pDX, IDC_MONI_PAHT, m_moni_path);
	DDX_Text(pDX, IDC_FIRSTNUM, m_firstnum);
	DDX_Text(pDX, IDC_TXT_PATH, m_txtpath);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCutDlg, CDialog)
	//{{AFX_MSG_MAP(CCutDlg)
	ON_BN_CLICKED(IDC_SAR_ORG, OnSarOrg)
	ON_BN_CLICKED(IDC_REF_ORG, OnRefOrg)
	ON_BN_CLICKED(IDC_DIM_ORG, OnDimOrg)
	ON_BN_CLICKED(IDC_MONI, OnMoni)
	ON_BN_CLICKED(IDC_SAR_REFERENCT, OnSarReferenct)
	ON_BN_CLICKED(IDC_REF_REFERENCT, OnRefReferenct)
	ON_BN_CLICKED(IDC_DIM_REFERENCT, OnDimReferenct)
	ON_CBN_SELCHANGE(IDC_COMBO_HEIGHT, OnSelchangeComboHeight)
	ON_CBN_SELCHANGE(IDC_PLACE, OnSelchangePlace)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCutDlg message handlers
CString temppath;
CString pathname;
void CCutDlg::OnSarOrg() 
{
	char ext[] = "picture types (*.bmp)|*.bmp|picture types (*.pic)|*.pic||";
	CFileDialog dlg(TRUE,"bmp" ,"*.bmp",OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ,ext, NULL);			
	if(dlg.DoModal()==IDOK)
	{		
		m_sarpath=dlg.GetPathName();
		m_moni_path=dlg.GetPathName();
		m_sar_c_path=dlg.GetPathName();
		pathname=dlg.GetPathName();
		temppath=dlg.GetFileName();
		CString temp;
		temp=dlg.GetFileName();		
		m_txtpath=dlg.GetPathName();
		if(region==0)
		{
			if(height==10000)
			{
				m_moni_path.Replace(temp,_T("wdOrgSAR10k001.raw"));
				m_sar_c_path.Replace(temp,_T("wdOrgRefSAR10k001.pic"));				
				m_txtpath.Replace(temp,"wdPos10k.txt");
			}
			if(height==8000)
			{
				m_moni_path.Replace(temp,_T("wdOrgSAR08k001.raw"));
				m_sar_c_path.Replace(temp,_T("wdOrgRefSAR08k001.pic"));
				m_txtpath.Replace(temp,"wdPos08k.txt");
			}
			if(height==6000)
			{
				m_moni_path.Replace(temp,_T("wdOrgSAR06k001.raw"));
				m_sar_c_path.Replace(temp,_T("wdOrgRefSAR06k001.pic"));
				m_txtpath.Replace(temp,"wdPos06k.txt");
			}
			if(height==4000)
			{
				m_moni_path.Replace(temp,_T("wdOrgSAR04k001.raw"));
				m_sar_c_path.Replace(temp,_T("wdOrgRefSAR04k001.pic"));
				m_txtpath.Replace(temp,"wdPos04k.txt");
			}
		}
		if(region==1)
		{
			if(height==10000)
			{
				m_moni_path.Replace(temp,_T("tgOrgSAR10k001.raw"));
				m_sar_c_path.Replace(temp,_T("tgOrgRefSAR10k001.pic"));
				m_txtpath.Replace(temp,"tgPos10k.txt");
			}
			if(height==8000)
			{
				m_moni_path.Replace(temp,_T("tgOrgSAR08k001.raw"));
				m_sar_c_path.Replace(temp,_T("tgOrgRefSAR08k001.pic"));
				m_txtpath.Replace(temp,"tgPos08k.txt");
			}
			if(height==6000)
			{
				m_moni_path.Replace(temp,_T("tgOrgSAR06k001.raw"));
				m_sar_c_path.Replace(temp,_T("tgOrgRefSAR06k001.pic"));
				m_txtpath.Replace(temp,"tgPos06k.txt");
			}
			if(height==4000)
			{
				m_moni_path.Replace(temp,_T("tgdOrgSAR04k001.raw"));
				m_sar_c_path.Replace(temp,_T("tgOrgRefSAR04k001.pic"));
				m_txtpath.Replace(temp,"tgPos04k.txt");
			}
		}
		
	}
	UpdateData(FALSE);

}

void CCutDlg::OnRefOrg() 
{
	char ext[] = "picture types (*.bmp)|*.bmp|picture types (*.pic)|*.pic||";
	CFileDialog dlg(TRUE,"bmp" ,"*.bmp",OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ,ext, NULL);			
	if(dlg.DoModal()==IDOK)
	{		
		m_refpath=dlg.GetPathName();
		m_ref_c_path=pathname;
		if(region==0)
		{
			if(height==10000)
			{
				m_ref_c_path.Replace(temppath,_T("wdOrgRefOPT10k001.pic"));
			}
			if(height==8000)
			{				
				m_ref_c_path.Replace(temppath,_T("wdOrgRefOPT08k001.pic"));
			}
			if(height==6000)
			{
				m_ref_c_path.Replace(temppath,_T("wdOrgRefOPT06k001.pic"));
			}
			if(height==4000)
			{
				m_ref_c_path.Replace(temppath,_T("wdOrgRefOPT04k001.pic"));
			}
		}
		if(region==1)
		{
			if(height==10000)
			{
				m_ref_c_path.Replace(temppath,_T("tgOrgRefOPT10k001.pic"));
			}
			if(height==8000)
			{
				m_ref_c_path.Replace(temppath,_T("tgOrgRefOPT08k001.pic"));
			}
			if(height==6000)
			{
				m_ref_c_path.Replace(temppath,_T("tgOrgRefOPT06k001.pic"));
			}
			if(height==4000)
			{
				m_ref_c_path.Replace(temppath,_T("tgOrgRefOPT04k001.pic"));
			}
		}
		
	}
	UpdateData(FALSE);
}

void CCutDlg::OnDimOrg() 
{
	char ext[] = "picture types (*.raw)|*.raw||";
	CFileDialog dlg(TRUE,"raw" ,"*.raw",OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ,ext, NULL);			
	if(dlg.DoModal()==IDOK)
	{		
		m_dimpath=dlg.GetPathName();	
		m_dim_c_path=pathname;
		if(region==0)
		{
			if(height==10000)
			{
				m_dim_c_path.Replace(temppath,_T("wdOrgDEM10k001.raw"));
			}
			if(height==8000)
			{				
				m_dim_c_path.Replace(temppath,_T("wdOrgDEM08k001.raw"));
			}
			if(height==6000)
			{
				m_dim_c_path.Replace(temppath,_T("wdOrgDEM06k001.raw"));
			}
			if(height==4000)
			{
				m_dim_c_path.Replace(temppath,_T("wdOrgDEM04k001.raw"));
			}
		}
		if(region==1)
		{
			if(height==10000)
			{
				m_dim_c_path.Replace(temppath,_T("tgOrgDEM10k001.raw"));
			}
			if(height==8000)
			{
				m_dim_c_path.Replace(temppath,_T("tgOrgDEM08k001.raw"));
			}
			if(height==6000)
			{
				m_dim_c_path.Replace(temppath,_T("tgOrgDEM06k001.raw"));
			}
			if(height==4000)
			{
				m_dim_c_path.Replace(temppath,_T("tgOrgDEM04k001.raw"));
			}
		}
	}	
	UpdateData(FALSE);
}

void CCutDlg::OnMoni() 
{
	char ext[] = "picture types (*.raw)|*.raw||";
	CFileDialog dlg(FALSE,"raw" ,"*.raw",OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ,ext, NULL);			
	if(dlg.DoModal()==IDOK)
	{		
	}
}

void CCutDlg::OnSarReferenct() 
{
	char ext[] = "picture types (*.pic)|*.pic||";
	CFileDialog dlg(FALSE,"pic" ,"*.pic",OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ,ext, NULL);			
	if(dlg.DoModal()==IDOK)
	{		
	}
}

void CCutDlg::OnRefReferenct() 
{
	char ext[] = "picture types (*.pic)|*.pic||";
	CFileDialog dlg(FALSE,"pic" ,"*.pic",OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ,ext, NULL);			
	if(dlg.DoModal()==IDOK)
	{		
	}

}

void CCutDlg::OnDimReferenct() 
{
	char ext[] = "picture types (*.pic)|*.pic||";
	CFileDialog dlg(FALSE,"pic" ,"*.pic",OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ,ext, NULL);			
	if(dlg.DoModal()==IDOK)
	{		
	}
}

void CCutDlg::OnSelchangeComboHeight() 
{
	CString temp;
	m_height.GetLBText(m_height.GetCurSel(),temp);	
	if(!temp.CompareNoCase ("10k"))
		height=10000;
	if(!temp.CompareNoCase ("8k"))
		height=8000;
	if(!temp.CompareNoCase ("6k"))
		height=6000;
	if(!temp.CompareNoCase ("4k"))
		height=4000;
}

void CCutDlg::OnSelchangePlace() 
{
	CString temp;
	m_place.GetLBText(m_place.GetCurSel(),temp);
	if(!temp.CompareNoCase("文登"))
		region=0;
	if(!temp.CompareNoCase("塘沽"))
		region=1;
}

BOOL CCutDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	m_height.SetCurSel(0);	
	m_place.SetCurSel(1);
	region=0;
	height=10000;
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CCutDlg::OnOK() 
{
	UpdateData(TRUE);
	CDialog::OnOK();
}

⌨️ 快捷键说明

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