www.pudn.com > RSImageManger.rar > GeocodeDlg.cpp


// GeocodeDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "ImageManger.h" 
//#include "IMGManger.h" 
#include "GeocodeDlg.h" 
#include  
#include  
 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CGeocodeDlg dialog 
 
 
CGeocodeDlg::CGeocodeDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CGeocodeDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CGeocodeDlg) 
	m_Y2 = 0.0; 
	m_X2 = 0.0; 
	m_resolutiony = 0.0; 
	m_filename = _T(""); 
	m_resolutionx = 0.0; 
	m_I = 0.0; 
	m_J = 0.0; 
	m_Y = 0.0; 
	m_X = 0.0; 
	m_I2 = 0.0; 
	m_J2 = 0.0; 
	//}}AFX_DATA_INIT 
} 
 
 
void CGeocodeDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CGeocodeDlg) 
	DDX_Text(pDX, IDC_EDIT10, m_Y2); 
	DDX_Text(pDX, IDC_EDIT11, m_X2); 
	DDX_Text(pDX, IDC_EDIT12, m_resolutiony); 
	DDX_Text(pDX, IDC_EDIT2, m_filename); 
	DDX_Text(pDX, IDC_EDIT3, m_resolutionx); 
	DDX_Text(pDX, IDC_EDIT4, m_I); 
	DDX_Text(pDX, IDC_EDIT5, m_J); 
	DDX_Text(pDX, IDC_EDIT6, m_Y); 
	DDX_Text(pDX, IDC_EDIT7, m_X); 
	DDX_Text(pDX, IDC_EDIT8, m_I2); 
	DDX_Text(pDX, IDC_EDIT9, m_J2); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CGeocodeDlg, CDialog) 
	//{{AFX_MSG_MAP(CGeocodeDlg) 
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1) 
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CGeocodeDlg message handlers 
 
void CGeocodeDlg::OnButton1()  
{ 
	// TODO: Add your control notification handler code here 
	UpdateData(); 
 
	CFileDialog dlg(TRUE,"bmp",NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, 
		"Windows BMP(*.bmp)|*.bmp||");	 
	if(dlg.DoModal()!=IDOK) return; 
 
	m_filename=dlg.GetPathName(); 
 
	UpdateData(FALSE); 
 
} 
 
void CGeocodeDlg::OnButton2()  
{ 
	// TODO: Add your control notification handler code here 
	UpdateData(); 
	double x,y; 
	if(fabs(m_I2-m_I)<=0 || fabs(m_J-m_J2)<=0) return; 
	x=(m_Y2-m_Y)/(m_I2-m_I); 
	y=(m_X2-m_X)/(m_J-m_J2); 
	if(x<=0 || y<=0) return; 
	m_resolutionx=x; 
	m_resolutiony=y; 
	UpdateData(FALSE); 
 
}