grayenhance.txt

来自「有关图像处理的程序」· 文本 代码 · 共 68 行

TXT
68
字号
// GrayEnhance.cpp : implementation file
//

#include "stdafx.h"
#include "dimageprocess.h"
#include "GrayEnhance.h"

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

/////////////////////////////////////////////////////////////////////////////
// CGrayEnhance dialog


CGrayEnhance::CGrayEnhance(CWnd* pParent /*=NULL*/)
	: CDialog(CGrayEnhance::IDD, pParent)
{
	//{{AFX_DATA_INIT(CGrayEnhance)
	m_oralow = 0;
	m_orahig = 255;
	m_newlow = 0;
	m_newhig = 255;
	//}}AFX_DATA_INIT
}


void CGrayEnhance::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CGrayEnhance)
	DDX_Text(pDX, IDC_EDIT1, m_oralow);
	DDX_Text(pDX, IDC_EDIT2, m_orahig);
	DDX_Text(pDX, IDC_EDIT3, m_newlow);
	DDX_Text(pDX, IDC_EDIT4, m_newhig);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CGrayEnhance, CDialog)
	//{{AFX_MSG_MAP(CGrayEnhance)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGrayEnhance message handlers

void CGrayEnhance::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(TRUE);
	
	// 判断设置是否有效
	if ((m_oralow < 0) || (m_orahig > 255) ||(m_oralow > m_orahig)||
		(m_newlow < 0) || (m_newhig > 255)||(m_newlow > m_newhig))
	{
		// 提示用户参数设置错误
		MessageBox("参数设置错误!", "系统提示" , MB_ICONINFORMATION | MB_OK);
		
		// 返回
		return;
	}
	
	CDialog::OnOK();
}

⌨️ 快捷键说明

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