86 lines
3.9 KiB
C++
86 lines
3.9 KiB
C++
// ImageProcess.cpp: 实现文件
|
||
//
|
||
|
||
#include "stdafx.h"
|
||
#include "ImageProcess.h"
|
||
#include "afxdialogex.h"
|
||
#include "resource.h"
|
||
//#include "UI_INI.h"
|
||
|
||
// ImageProcess 对话框0
|
||
//extern CUI_INI* m_pUI_INI;
|
||
|
||
IMPLEMENT_DYNAMIC(ImageProcess, CDialog)
|
||
|
||
ImageProcess::ImageProcess(CWnd* pParent /*=nullptr*/)
|
||
: CDialog(IDD_DIALOG_PAGEIMGPROC, pParent)
|
||
{
|
||
|
||
}
|
||
|
||
ImageProcess::~ImageProcess()
|
||
{
|
||
}
|
||
|
||
void ImageProcess::DoDataExchange(CDataExchange* pDX)
|
||
{
|
||
CDialog::DoDataExchange(pDX);
|
||
DDX_Control(pDX, IDC_CMBFILTER, m_cmBoxFilter);
|
||
DDX_Control(pDX, IDC_SLDEAGEENHANCE, m_sldEageEnhance);
|
||
DDX_Control(pDX, IDC_SLDCHARENHACE, m_sldCharEnhance);
|
||
}
|
||
|
||
|
||
BEGIN_MESSAGE_MAP(ImageProcess, CDialog)
|
||
ON_WM_HSCROLL()
|
||
END_MESSAGE_MAP()
|
||
|
||
|
||
// ImageProcess 消息处理程序
|
||
|
||
|
||
BOOL ImageProcess::OnInitDialog()
|
||
{
|
||
CDialog::OnInitDialog();
|
||
OnInitcmBoxFilter(0);
|
||
OnInitsldCharEnhance(4);
|
||
OnInitsldEageEnhance(0);
|
||
// TODO: 在此添加额外的初始化
|
||
return TRUE; // return TRUE unless you set the focus to a control
|
||
// 异常: OCX 属性页应返回 FALSE
|
||
}
|
||
|
||
|
||
void ImageProcess::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||
{
|
||
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
||
|
||
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
|
||
}
|
||
|
||
void ImageProcess::OnInitcmBoxFilter(int selectIndex)
|
||
{
|
||
m_cmBoxFilter.InsertString(0,_T("不除色"));
|
||
m_cmBoxFilter.InsertString(1, _T("除红色"));
|
||
m_cmBoxFilter.InsertString(2, _T("除绿色"));
|
||
m_cmBoxFilter.InsertString(3, _T("除蓝色"));
|
||
m_cmBoxFilter.InsertString(4, _T("红色增强"));
|
||
m_cmBoxFilter.InsertString(5, _T("绿色增强"));
|
||
m_cmBoxFilter.InsertString(6, _T("蓝色增强"));
|
||
m_cmBoxFilter.SetCurSel(selectIndex);
|
||
}
|
||
|
||
void ImageProcess::OnInitsldEageEnhance(int selectIndex)
|
||
{
|
||
m_sldEageEnhance.SetRange(-2,2);
|
||
m_sldEageEnhance.SetTicFreq(1);
|
||
m_sldEageEnhance.SetPos(selectIndex);
|
||
}
|
||
|
||
void ImageProcess::OnInitsldCharEnhance(int selectIndex)
|
||
{
|
||
m_sldCharEnhance.SetRange(1, 7);
|
||
m_sldCharEnhance.SetTicFreq(1);
|
||
m_sldCharEnhance.SetPos(selectIndex);
|
||
}
|