-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterpolDlg.cpp
More file actions
77 lines (59 loc) · 1.63 KB
/
InterpolDlg.cpp
File metadata and controls
77 lines (59 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// InterpolDlg.cpp: 实现文件
//
#include "imageProcessing.h"
#include "afxdialogex.h"
#include "InterpolDlg.h"
// InterpolDlg 对话框
IMPLEMENT_DYNAMIC(InterpolDlg, CDialogEx)
InterpolDlg::InterpolDlg(CWnd* pParent /*=nullptr*/)
: CDialogEx(INTERPOL_DLG, pParent)
, width(0)
, height(0)
, nearest(1)
, double_linear(0)
{
}
InterpolDlg::~InterpolDlg()
{
}
void InterpolDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, INTER_WIDTH, width);
DDX_Text(pDX, INTER_HEIGHT, height);
DDX_Radio(pDX, NEAREST, nearest);
DDX_Radio(pDX, DOUBLE_LINEAR, double_linear);
}
BEGIN_MESSAGE_MAP(InterpolDlg, CDialogEx)
ON_BN_CLICKED(DOUBLE_LINEAR, &InterpolDlg::OnBnClickedLinear)
ON_BN_CLICKED(NEAREST, &InterpolDlg::OnBnClickedNearest)
END_MESSAGE_MAP()
BOOL InterpolDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// 设置Radio Button初始状态
CButton* pRadioButton = (CButton*)GetDlgItem(NEAREST);
pRadioButton->SetCheck(BST_CHECKED);
pRadioButton = (CButton*)GetDlgItem(DOUBLE_LINEAR);
pRadioButton->SetCheck(BST_UNCHECKED);
return TRUE;
}
// InterpolDlg 消息处理程序
void InterpolDlg::OnBnClickedLinear()
{
CButton* pRadioButton = (CButton*)GetDlgItem(DOUBLE_LINEAR);
pRadioButton->SetCheck(BST_CHECKED);
pRadioButton = (CButton*)GetDlgItem(NEAREST);
pRadioButton->SetCheck(BST_UNCHECKED);
nearest = 1;
double_linear = 0;
}
void InterpolDlg::OnBnClickedNearest()
{
CButton* pRadioButton = (CButton*)GetDlgItem(NEAREST);
pRadioButton->SetCheck(BST_CHECKED);
pRadioButton = (CButton*)GetDlgItem(DOUBLE_LINEAR);
pRadioButton->SetCheck(BST_UNCHECKED);
nearest = 0;
double_linear = 1;
}