-
Notifications
You must be signed in to change notification settings - Fork 3
/
dlg_resize.pas
99 lines (77 loc) · 2.5 KB
/
dlg_resize.pas
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
unit dlg_resize;
//Lazzy Image Viewer
//github.com/PascalVault
//License: GNU/GPL
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
ExtCtrls, PV_Filters;
type
{ TResizeDlg }
TResizeDlg = class(TForm)
Button1: TButton;
Button2: TButton;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
RG: TRadioGroup;
UpDown3: TUpDown;
UpDown4: TUpDown;
UpDown5: TUpDown;
UpDown6: TUpDown;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
public
end;
var
ResizeDlg: TResizeDlg;
implementation
uses Unit1;
{$R *.lfm}
{ TResizeDlg }
procedure TResizeDlg.Button1Click(Sender: TObject);
begin
Form1.SaveUndo;
case RG.ItemIndex of
0: Form1.GetBmp.Resize(UpDown3.Position, UpDown4.Position);
1: Form1.GetBmp.Resample(UpDown3.Position, UpDown4.Position, rfBox);
2: Form1.GetBmp.Resample(UpDown3.Position, UpDown4.Position, rfBilinear);
3: Form1.GetBmp.Resample(UpDown3.Position, UpDown4.Position, rfBell);
4: Form1.GetBmp.Resample(UpDown3.Position, UpDown4.Position, rfHermite);
5: Form1.GetBmp.Resample(UpDown3.Position, UpDown4.Position, rfLanczos3);
6: Form1.GetBmp.Resample(UpDown3.Position, UpDown4.Position, rfMitchell);
7: Form1.GetBmp.Resample(UpDown3.Position, UpDown4.Position, rfSpline);
end;
Form1.Redraw;
Close;
end;
procedure TResizeDlg.Button2Click(Sender: TObject);
begin
Form1.SaveUndo;
case RG.ItemIndex of
0: Form1.GetBmp.ResizePercent(UpDown5.Position, UpDown6.Position);
1: Form1.GetBmp.ResamplePercent(UpDown5.Position, UpDown6.Position, rfBox);
2: Form1.GetBmp.ResamplePercent(UpDown5.Position, UpDown6.Position, rfBilinear);
3: Form1.GetBmp.ResamplePercent(UpDown5.Position, UpDown6.Position, rfBell);
4: Form1.GetBmp.ResamplePercent(UpDown5.Position, UpDown6.Position, rfHermite);
5: Form1.GetBmp.ResamplePercent(UpDown5.Position, UpDown6.Position, rfLanczos3);
6: Form1.GetBmp.ResamplePercent(UpDown5.Position, UpDown6.Position, rfMitchell);
7: Form1.GetBmp.ResamplePercent(UpDown5.Position, UpDown6.Position, rfSpline);
end;
Form1.Redraw;
Close;
end;
end.