www.pudn.com > Imagepro.rar > DlgMorph.cpp


#include "stdafx.h" 
#include "ImgPro.h" 
#include "DlgMorph.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
///////////////////////////////////////////////////////////////////////////// 
// CDlgMorph dialog 
 
CDlgMorph::CDlgMorph(CWnd* pParent /*=NULL*/) 
	: CDialog(CDlgMorph::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CDlgMorph) 
	m_Element0_0 = 0; 
	m_Element0_1 = 0; 
	m_Element1_0 = 0; 
	m_Element1_1 = 0; 
	//}}AFX_DATA_INIT 
} 
 
 
void CDlgMorph::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CDlgMorph) 
	DDX_Text(pDX, IDC_EDIT1, m_Element0_0); 
	DDV_MinMaxInt(pDX, m_Element0_0, 0, 255); 
	DDX_Text(pDX, IDC_EDIT2, m_Element0_1); 
	DDV_MinMaxInt(pDX, m_Element0_1, 0, 255); 
	DDX_Text(pDX, IDC_EDIT3, m_Element1_0); 
	DDV_MinMaxInt(pDX, m_Element1_0, 0, 255); 
	DDX_Text(pDX, IDC_EDIT4, m_Element1_1); 
	DDV_MinMaxInt(pDX, m_Element1_1, 0, 255); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CDlgMorph, CDialog) 
	//{{AFX_MSG_MAP(CDlgMorph) 
	 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CDlgMorph message handlers 
 
void CDlgMorph::ImgOperationCase() 
{ 
	switch(eImgOperation) 
	{ 
	case eDilationGrayImage: 
			structure[0][0] = m_Element0_0; 
	        structure[0][1] = m_Element0_1; 
	        structure[1][0] = m_Element1_0; 
	        structure[1][1] = m_Element1_1; 
	case eErosionGrayImage: 
		    structure[0][0] = m_Element0_0; 
	        structure[0][1] = m_Element0_1; 
	        structure[1][0] = m_Element1_0; 
	        structure[1][1] = m_Element1_1; 
	case eOpenGrayImage: 
		    structure[0][0] = m_Element0_0; 
	        structure[0][1] = m_Element0_1; 
	        structure[1][0] = m_Element1_0; 
	        structure[1][1] = m_Element1_1; 
	case eCloseGrayImage: 
		    structure[0][0] = m_Element0_0; 
	        structure[0][1] = m_Element0_1; 
	        structure[1][0] = m_Element1_0; 
	        structure[1][1] = m_Element1_1; 
	case eTopHatGrayImage: 
		    structure[0][0] = m_Element0_0; 
	        structure[0][1] = m_Element0_1; 
	        structure[1][0] = m_Element1_0; 
	        structure[1][1] = m_Element1_1; 
	} 
}