📄 fillfiltergui.cpp
字号:
#include "resource.h"
#include "FillFilter.h"
#include <windows.h>
#include "MainGUI.h"
#include <commctrl.h>
BOOL CALLBACK FillFilter01DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) {
switch(Msg) {
case WM_INITDIALOG:
memcpy(&TempC3,&C3,sizeof(tTC_FILLFILTER01));
SendDlgItemMessage(hDlg,IDC_AUSDEHNUNGX,TBM_SETRANGE,true,MAKELONG(1,32));
SendDlgItemMessage(hDlg,IDC_AUSDEHNUNGX,TBM_SETPOS,true,C3.AusdehnungX);
SendDlgItemMessage(hDlg,IDC_AUSDEHNUNGY,TBM_SETRANGE,true,MAKELONG(1,32));
SendDlgItemMessage(hDlg,IDC_AUSDEHNUNGY,TBM_SETPOS,true,C3.AusdehnungY);
SendDlgItemMessage(hDlg,IDC_SLIDERCHANGE,TBM_SETRANGE,true,MAKELONG(1,127));
SendDlgItemMessage(hDlg,IDC_SLIDERCHANGE,TBM_SETPOS,true,C3.Change);
SendDlgItemMessage(hDlg,IDC_SLIDERRANDOM,TBM_SETRANGE,true,MAKELONG(0,500));
SendDlgItemMessage(hDlg,IDC_SLIDERRANDOM,TBM_SETPOS,true,C3.RandomStart);
SendDlgItemMessage(hDlg,IDC_SLIDERPARTIKEL,TBM_SETRANGE,true,MAKELONG(1,150));
SendDlgItemMessage(hDlg,IDC_SLIDERPARTIKEL,TBM_SETPOS,true,C3.StartPartikel);
SendDlgItemMessage(hDlg,IDC_SLIDERSTART,TBM_SETRANGE,true,MAKELONG(1,255));
SendDlgItemMessage(hDlg,IDC_SLIDERSTART,TBM_SETPOS,true,C3.StartValue);
switch(C3.Channel) {
case 0: CheckDlgButton(hDlg,IDC_RADIO1,BST_CHECKED); break;
case 1: CheckDlgButton(hDlg,IDC_RADIO2,BST_CHECKED); break;
case 2: CheckDlgButton(hDlg,IDC_RADIO3,BST_CHECKED); break;
case 3: CheckDlgButton(hDlg,IDC_RADIO4,BST_CHECKED); break;
case 4: CheckDlgButton(hDlg,IDC_RADIO5,BST_CHECKED); break;
}
return false;
break;
case WM_HSCROLL:
C3.AusdehnungX=SendDlgItemMessage(hDlg,IDC_AUSDEHNUNGX,TBM_GETPOS,0,0);
C3.AusdehnungY=SendDlgItemMessage(hDlg,IDC_AUSDEHNUNGY,TBM_GETPOS,0,0);
C3.Change=SendDlgItemMessage(hDlg,IDC_SLIDERCHANGE,TBM_GETPOS,0,0);
C3.RandomStart=SendDlgItemMessage(hDlg,IDC_SLIDERRANDOM,TBM_GETPOS,0,0);
C3.StartPartikel=SendDlgItemMessage(hDlg,IDC_SLIDERPARTIKEL,TBM_GETPOS,0,0);
C3.StartValue=SendDlgItemMessage(hDlg,IDC_SLIDERSTART,TBM_GETPOS,0,0);
break;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDC_PREVIEW:
InitPreview();
FillbertFilter01(TempPic,&C3);
Preview();
break;
case IDC_OK:
FillbertFilter01(Image,&C3);
EndDialog(hDlg,1);
break;
case IDC_CANCEL:
memcpy(&C3,&TempC3,sizeof(tTC_FILLFILTER01));
EndDialog(hDlg,0);
break;
case IDC_RADIO1:C3.Channel=0;break;
case IDC_RADIO2:C3.Channel=1;break;
case IDC_RADIO3:C3.Channel=2;break;
case IDC_RADIO4:C3.Channel=3;break;
case IDC_RADIO5:C3.Channel=4;break;
}
break;
default:
return false;
}
return true;
}
BOOL CALLBACK FillFilter02DialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) {
switch(Msg) {
case WM_INITDIALOG:
memcpy(&TempC4,&C4,sizeof(tTC_FILLFILTER02));
SetDlgItemInt(hDlg,IDC_NUMBER00,C4.Faktor[0][0],true);
SetDlgItemInt(hDlg,IDC_NUMBER10,C4.Faktor[1][0],true);
SetDlgItemInt(hDlg,IDC_NUMBER20,C4.Faktor[2][0],true);
SetDlgItemInt(hDlg,IDC_NUMBER01,C4.Faktor[0][1],true);
SetDlgItemInt(hDlg,IDC_NUMBER11,C4.Faktor[1][1],true);
SetDlgItemInt(hDlg,IDC_NUMBER21,C4.Faktor[2][1],true);
SetDlgItemInt(hDlg,IDC_NUMBER02,C4.Faktor[0][2],true);
SetDlgItemInt(hDlg,IDC_NUMBER12,C4.Faktor[1][2],true);
SetDlgItemInt(hDlg,IDC_NUMBER22,C4.Faktor[2][2],true);
return false;
break;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDC_PREVIEWFILLFILTER02:
C4.Faktor[0][0] = GetDlgItemInt(hDlg,IDC_NUMBER00,false,true);
C4.Faktor[1][0] = GetDlgItemInt(hDlg,IDC_NUMBER10,false,true);
C4.Faktor[2][0] = GetDlgItemInt(hDlg,IDC_NUMBER20,false,true);
C4.Faktor[0][1] = GetDlgItemInt(hDlg,IDC_NUMBER01,false,true);
C4.Faktor[1][1] = GetDlgItemInt(hDlg,IDC_NUMBER11,false,true);
C4.Faktor[2][1] = GetDlgItemInt(hDlg,IDC_NUMBER21,false,true);
C4.Faktor[0][2] = GetDlgItemInt(hDlg,IDC_NUMBER02,false,true);
C4.Faktor[1][2] = GetDlgItemInt(hDlg,IDC_NUMBER12,false,true);
C4.Faktor[2][2] = GetDlgItemInt(hDlg,IDC_NUMBER22,false,true);
InitPreview();
FillbertFilter02(TempPic,&C4);
Preview();
break;
case IDC_OKFILLFILTER02:
FillbertFilter02(Image,&C4);
EndDialog(hDlg,1);
break;
case IDC_CANCEL:
memcpy(&C4,&TempC4,sizeof(tTC_FILLFILTER02));
EndDialog(hDlg,0);
break;
}
break;
default:
return false;
}
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -