www.pudn.com > 图像处理源代码.rar > TransSet.cpp


// TransSet.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "tuxiang.h" 
#include "TransSet.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CTransSet dialog 
 
 
CTransSet::CTransSet(CWnd* pParent /*=NULL*/) 
	: CDialog(CTransSet::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CTransSet) 
	m_bRotate = FALSE; 
	m_bXoff = FALSE; 
	m_bXscale = FALSE; 
	m_bYoff = FALSE; 
	m_bYscale = FALSE; 
	m_rotate = 0.0f; 
	m_xoff = 0.0f; 
	m_xscale = 1.0f; 
	m_yoff = 0.0f; 
	m_yscale = 1.0f; 
	//}}AFX_DATA_INIT 
} 
 
 
void CTransSet::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CTransSet) 
	DDX_Control(pDX, IDC_EYSCALE, m_eYscale); 
	DDX_Control(pDX, IDC_EYOFF, m_eYoff); 
	DDX_Control(pDX, IDC_EXSCALE, m_eXscale); 
	DDX_Control(pDX, IDC_EXOFF, m_eXoff); 
	DDX_Control(pDX, IDC_EROTATE, m_eRotate); 
	DDX_Check(pDX, IDC_ROTATE, m_bRotate); 
	DDX_Check(pDX, IDC_XOFF, m_bXoff); 
	DDX_Check(pDX, IDC_XSCALE, m_bXscale); 
	DDX_Check(pDX, IDC_YOFF, m_bYoff); 
	DDX_Check(pDX, IDC_YSCALE, m_bYscale); 
	DDX_Text(pDX, IDC_EROTATE, m_rotate); 
	DDV_MinMaxFloat(pDX, m_rotate, -360.f, 360.f); 
	DDX_Text(pDX, IDC_EXOFF, m_xoff); 
	DDV_MinMaxFloat(pDX, m_xoff, -150.f, 150.f); 
	DDX_Text(pDX, IDC_EXSCALE, m_xscale); 
	DDV_MinMaxFloat(pDX, m_xscale, 0.f, 10.f); 
	DDX_Text(pDX, IDC_EYOFF, m_yoff); 
	DDV_MinMaxFloat(pDX, m_yoff, -150.f, 150.f); 
	DDX_Text(pDX, IDC_EYSCALE, m_yscale); 
	DDV_MinMaxFloat(pDX, m_yscale, 0.f, 10.f); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CTransSet, CDialog) 
	//{{AFX_MSG_MAP(CTransSet) 
	ON_BN_CLICKED(IDC_ROTATE, OnRotate) 
	ON_BN_CLICKED(IDC_XOFF, OnXoff) 
	ON_BN_CLICKED(IDC_XSCALE, OnXscale) 
	ON_BN_CLICKED(IDC_YOFF, OnYoff) 
	ON_BN_CLICKED(IDC_YSCALE, OnYscale) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CTransSet message handlers 
 
void CTransSet::OnRotate()  
{ 
	m_bRotate = !m_bRotate; 
	m_eRotate.EnableWindow(m_bRotate); 
	if(m_bRotate) 
	{ 
		m_eRotate.SetFocus(); 
		m_eRotate.SetSel(0,-1);		//Select All 
	} 
	else 
		m_rotate=0.0; 
} 
 
void CTransSet::OnXoff()  
{ 
	m_bXoff = !m_bXoff; 
	m_eXoff.EnableWindow(m_bXoff); 
	if(m_bXoff) 
	{ 
		m_eXoff.SetFocus(); 
		m_eXoff.SetSel(0,-1);		//Select All 
	} 
	else 
		m_xoff=0.0; 
} 
 
void CTransSet::OnXscale()  
{ 
	m_bXscale = !m_bXscale; 
	m_eXscale.EnableWindow(m_bXscale); 
	if(m_bXscale) 
	{ 
		m_eXscale.SetFocus(); 
		m_eXscale.SetSel(0,-1);		//Select All 
	} 
	else 
		m_xscale=1.0; 
} 
 
void CTransSet::OnYoff()  
{ 
	m_bYoff = !m_bYoff; 
	m_eYoff.EnableWindow(m_bYoff); 
	if(m_bYoff) 
	{ 
		m_eYoff.SetFocus(); 
		m_eYoff.SetSel(0,-1);		//Select All 
	} 
	else 
		m_yoff=0.0; 
} 
 
void CTransSet::OnYscale()  
{ 
	m_bYscale = !m_bYscale; 
	m_eYscale.EnableWindow(m_bYscale); 
	if(m_bYscale) 
	{ 
		m_eYscale.SetFocus(); 
		m_eYscale.SetSel(0,-1);		//Select All 
	} 
	else 
		m_yscale=1.0; 
}