-
Notifications
You must be signed in to change notification settings - Fork 0
/
Unit1.~pas
415 lines (364 loc) · 11.8 KB
/
Unit1.~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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, XPMan, ExtDlgs, JPEG;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
XPManifest1: TXPManifest;
Image1: TImage;
RadioGroup1: TRadioGroup;
Button3: TButton;
Button4: TButton;
RadioGroup2: TRadioGroup;
FadeIn: TTimer;
FadeOut: TTimer;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
Label2: TLabel;
RadioGroup3: TRadioGroup;
FontDialog1: TFontDialog;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Image5: TImage;
Image6: TImage;
Image7: TImage;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure RadioGroup2Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FadeInTimer(Sender: TObject);
procedure FadeOutTimer(Sender: TObject);
procedure Label2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure RadioGroup3Click(Sender: TObject);
procedure Image3Click(Sender: TObject);
procedure Image4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
pic: HDC;
pcnvs: TCanvas;
pw, ph, l, t: Integer;
noFileLoadedErr, noEffChoseErr, demMsgT, demMsgB, demMsgTS, mMsgT, errMsg: string;
jpgpic: TJPEGImage;
bmppic: TBitmap;
implementation
{$R *.dfm}
uses Unit2, Unit3;
{ Äàëüøå áóäóò ïðîöåäóðû äëÿ òåõ èëè èíûõ âåùåé.
Ïîçæå ÿ áóäó èõ îáúÿâëÿòü. }
procedure GetDesktop;
begin
pw := Form1.Image1.Picture.Width;
ph := Form1.Image1.Picture.Height;
pcnvs := Form1.Image1.Canvas;
pic := pcnvs.Handle;
l := Random(pw);
t := Random(ph);
end;
procedure DrawWatermark; { Âîäÿíîé çíàê }
begin
GetDesktop;
pcnvs.Brush.Color := $FFFFFF;
pcnvs.Font.Color := $000000;
pcnvs.Font.Name := 'System';
pcnvs.Font.Size := 8;
pcnvs.TextOut(0, ph - 16, 'FotoDezz made by NobootRecord (vk.com/NobootRecord)');
end;
procedure Sickness; { Æìûõ }
begin
pic := Form1.Image1.Canvas.Handle;
GetDesktop;
StretchBlt(pic, 1, t, pw+2, t, pic, 0, t, pw, t, SRCCOPY);
StretchBlt(pic, l, 1, l, ph+2, pic, l, 0, l, ph, SRCCOPY);
StretchBlt(pic, 0, t, pw, t, pic, 1, t, pw+2, t, SRCCOPY);
StretchBlt(pic, l, 0, l, ph, pic, l, 1, l, ph+2, SRCCOPY);
end;
procedure Otval; { ÎÒÂÀË âèäåîêàðòû :) }
begin
GetDesktop;
StretchBlt(pic, 0, 0, pw, ph, pic, l, t, 1, 1, SRCINVERT);
end;
procedure Inversia; { Èíâåðñèÿ, êàê â MEMZ Trojan }
begin
GetDesktop;
BitBlt(pic, 0, 0, pw, ph, pic, 0, 0, NOTSRCCOPY);
end;
procedure Demotivator; { Ìåì-äåìîòèâàòîð (êðèâî ðàáîòàåò) }
var
ttxt, btxt: string;
txtsyz: Integer;
begin
ttxt := InputBox('FotoDezz', demMsgT, 'TOP TEXT');
btxt := InputBox('FotoDezz', demMsgB, 'BOTTOM TEXT');
txtsyz := StrToInt(InputBox('FotoDezz', demMsgTS, '24'));
GetDesktop;
pcnvs.Brush.Color := $000000;
pcnvs.Font.Color := $FFFFFF;
pcnvs.Font.Name := 'Impact';
pcnvs.Font.Size := txtsyz;
pcnvs.TextOut(pw div 2 - (pw div 8), 0, ttxt);
pcnvs.TextOut(pw div 2 - (pw div 8), ph - (ph div 16), btxt);
end;
procedure NewMeme; { Ìåì ñ êðàñèâîé ïîäïèñüþ }
var
mtxt: string;
begin
mtxt := InputBox('FotoDezz', mMsgT, 'Sample Text');
if Form1.FontDialog1.Execute then begin
GetDesktop;
pcnvs.Font := Form1.FontDialog1.Font;;
pcnvs.TextOut(Round(Form1.FontDialog1.Font.Size * 2), ph - (Form1.FontDialog1.Font.Size * 3), mtxt);
pcnvs.Brush.Color := not Form1.FontDialog1.Font.Color;
DrawWatermark;
end;
end;
procedure ShirokyPutin; { Øèðîêèé Ïóòèí }
begin
GetDesktop;
StretchBlt(pic, -20, 0, pw+40, ph, pic, 0, 0, pw, ph, SRCCOPY);
DrawWatermark;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
{ Îòêðûâàåì ôîòêó.
Åñëè ÷òî-òî ïîøëî íå òàê,
âûçûâàåì ïîÿñíèòåëüíóþ áðèãàäó }
if OpenDialog1.Execute
then begin
try
bmppic := TBitmap.Create;
jpgpic := TJPEGImage.Create;
jpgpic.LoadFromFile(OpenDialog1.FileName);
bmppic.Assign(jpgpic);
Image1.Picture.Assign(bmppic);
pic := Image1.Canvas.Handle;
pw := Image1.Picture.Width;
ph := Image1.Picture.Height;
Edit1.Text := OpenDialog1.FileName;
jpgpic.Free;
bmppic.Free;
Image1.Center := (Image1.Picture.Width < Image1.Width) or (Image1.Picture.Height < Image1.Height);
Image1.Stretch := (Image1.Picture.Width > Image1.Width) or (Image1.Picture.Height > Image1.Height);
except on E: Exception do MessageBoxA(Form1.Handle, PChar(errMsg), '>_<', MB_ICONERROR);
end;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
i: Integer;
begin
{ Åñëè íàäî, âûäà¸ì ñîîáùåíèÿ.
Åñëè âñ¸ â ïîðÿäêå, "óíè÷òîæàåì" êàðòèíêó
ñ ïîìîùüþ íàøèõ ïðîöåäóð }
if Edit1.Text = ''
then MessageBoxA(Form1.Handle, PChar(noFileLoadedErr), 'FotoDezz', MB_ICONERROR)
else begin
if RadioGroup1.ItemIndex = -1
then MessageBoxA(Form1.Handle, PChar(noEffChoseErr), 'FotoDezz', MB_ICONWARNING)
else begin
if RadioGroup1.ItemIndex = 0
then begin
for i := 1 to Random(1000)
do Sickness;
end;
if RadioGroup1.ItemIndex = 1
then Inversia;
if RadioGroup1.ItemIndex = 2
then Otval;
if RadioGroup1.ItemIndex = 3
then Demotivator;
if RadioGroup1.ItemIndex = 4
then begin
for i := 1 to Random(10)
do ShirokyPutin;
end;
if RadioGroup1.ItemIndex = 5
then NewMeme;
DrawWatermark; { Ðèñóåì âàòåðìàðê }
{ Ñîõðàíÿåì íàø ìèðîâîé øåäåâð èñêóññòâà }
if SaveDialog1.Execute
then begin
Image1.Picture.SaveToFile(SaveDialog1.FileName);
Edit1.Text := SaveDialog1.FileName;
Image1.Refresh;
end;
end;
end;
end;
procedure SetEnglish; { Àíãëèéñêàÿ ëîêàëèçàöèÿ }
begin
Form1.Label1.Caption := 'Picture:';
Form1.Button1.Caption := 'Import';
Form1.RadioGroup1.Caption := 'Destruction:';
Form1.RadioGroup1.Items.CommaText := 'Sickness'+#13+'Inverse'+#13+'Glitch'+#13+'Demotivator'+#13+'WidePutin'+#13+'BottomTextMeme';
Form1.RadioGroup2.Caption := 'Language:';
Form1.Button3.Caption := 'Destroy it!';
Form1.Button4.Caption := 'About';
Form1.RadioGroup3.Caption := 'Theme:';
Form1.RadioGroup3.Items.CommaText := 'Dark'+#13+'Light';
noFileLoadedErr := 'You did not load any picture!';
noEffChoseErr := 'You did not choice any effect!';
demMsgT := 'Please enter a top text of your demotivator:';
demMsgB := 'Please enter a bottom text of your demotivator:';
demMsgTS := 'Please enter a integer value of text size:';
errMsg := 'Sorry, but something gone wrong...'+#13+'Please try again later.'+#13+'If nothing helps, contact to developer (my contacts are in "About" window)';
Form2.Caption := 'About FotoDezz';
mMsgT := 'Please enter a text for meme:';
Form2.Label3.Caption := 'Author:'+#13+'Coded in:'+#13+'Version:'+#13+'Build Date:';
Form2.Label2.Caption := 'Ivan Movchan (NobootRecord)'+#13+'Borland Delphi 7.0'+#13+'1.5'+#13+'April 13, 2021';
Form2.Label4.Caption := 'Made';
Form2.Label5.Caption := 'in';
Form2.Label6.Caption := 'Russia';
Form2.Label7.Caption := 'Website';
Form2.Label8.Caption := 'VKontakte';
Form2.Label9.Caption := 'YouTube';
Form2.Label10.Caption := 'About modification';
Form3.Caption := 'About modification';
Form3.Label1.Caption := 'Creator: Alloyd Robloxian';
Form3.Label2.Caption := 'Please subscribe to my channel!';
Form1.Image3.Hint := 'Close';
Form1.Image4.Hint := 'Minimize';
end;
procedure SetRussian; { Ðóññêàÿ ëîêàëèçàöèÿ }
begin
Form1.Label1.Caption := 'Êàðòèíêà:';
Form1.Button1.Caption := 'Èìïîðò';
Form1.RadioGroup1.Caption := 'Èçâðàùåíèÿ:';
Form1.RadioGroup1.Items.CommaText := 'Æìûõ'+#13+'Èíâåðñèÿ'+#13+'Íàðêîìàíèÿ'+#13+'Äåìîòèâàòîð'+#13+'ØèðîêèéÏóòèí'+#13+'ÌåìÑÊðàñèâîéÏîäïèñüþ';
Form1.RadioGroup2.Caption := 'ßçûê:';
Form1.Button3.Caption := 'Óíè÷òîæèòü!';
Form1.Button4.Caption := 'Î ïðîãðàììå';
Form1.RadioGroup3.Caption := 'Òåìà:';
Form1.RadioGroup3.Items.CommaText := 'Ò¸ìíàÿ'+#13+'Ñâåòëàÿ';
noFileLoadedErr := 'Âû åù¸ íå çàãðóçèëè êàðòèíêó!';
noEffChoseErr := 'Âû íå âûáðàëè ýôôåêò äëÿ êàðòèíêè.'+#13+'Íå, íó òàê íåèíòåðåñíî... :(';
demMsgT := 'Ââåäèòå âåðõíèé òåêñò äåìîòèâàòîðà:';
demMsgB := 'Ââåäèòå íèæíèé òåêñò äåìîòèâàòîðà:';
demMsgTS := 'Ââåäèòå öåëîå çíà÷åíèå ðàçìåðà òåêñòà:';
mMsgT := 'Ââåäèòå òåêñò äëÿ ìåìà:';
errMsg := 'Êàæåòñÿ, ÷òî-òî ïîøëî íå òàê...'+#13+'Ïîïðîáóéòå ñäåëàòü ýòî çàíîâî ÷óòü ïîçæå.'+#13+'Íè÷åãî íå ðàáîòàåò? Ñâÿæèòåñü ñî ìíîé ÷åðåç îêíî "Î ïðîãðàììå"...';
Form2.Caption := 'Î FotoDezz';
Form2.Label3.Caption := 'Àâòîð:'+#13+'Èíñòðóìåíò:'+#13+'Âåðñèÿ:'+#13+'Äàòà ñáîðêè:';
Form2.Label2.Caption := 'Èâàí Ìîâ÷àí (NobootRecord)'+#13+'Borland Delphi 7.0'+#13+'1.5'+#13+'13 àïðåëÿ 2021 ã.';
Form2.Label4.Caption := 'Ñäåëàíî';
Form2.Label5.Caption := 'â';
Form2.Label6.Caption := 'Ðîññèè';
Form2.Label7.Caption := 'Âåá-ñàéò';
Form2.Label8.Caption := 'ÂÊîíòàêòå';
Form2.Label9.Caption := 'Þòóá';
Form2.Label10.Caption := 'Î ìîäèôèêàöèè';
Form3.Caption := 'Î ìîäèôèêàöèè';
Form3.Label1.Caption := 'Ñîçäàòåëü: Alloyd Robloxian';
Form3.Label2.Caption := 'Ïîæàëóéñòà, ïîäïèøèòåñü íà ìîé êàíàë!';
Form1.Image3.Hint := 'Çàêðûòü';
Form1.Image4.Hint := 'Ñâåðíóòü';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Randomize;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
Form2.Show;
end;
procedure TForm1.RadioGroup2Click(Sender: TObject);
begin
if RadioGroup2.ItemIndex = 0
then SetEnglish;
if RadioGroup2.ItemIndex = 1
then SetRussian;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caNone;
Image1.Free;
FadeOut.Enabled := true;
end;
procedure TForm1.FadeInTimer(Sender: TObject);
begin
Form1.AlphaBlendValue := Form1.AlphaBlendValue + 15;
if Form1.AlphaBlendValue = 255
then begin
FadeIn.Enabled := false;
SetEnglish;
end;
end;
procedure TForm1.FadeOutTimer(Sender: TObject);
begin
Form1.AlphaBlendValue := Form1.AlphaBlendValue - 15;
if Form1.AlphaBlendValue = 0
then Halt(0);
end;
procedure TForm1.Label2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); { Äâèãàåì îêíî, äåðæà åãî çà "øêèðêó" }
begin
ReleaseCapture;
Form1.Perform(WM_SysCommand, $F012, 0);
end;
procedure TForm1.RadioGroup3Click(Sender: TObject); { Ïåðåêëþ÷àåì ò¸ìíóþ è ñâåòëóþ òåìó }
begin
if RadioGroup3.ItemIndex = 0
then Form1.Color := $000000;
if RadioGroup3.ItemIndex = 1
then Form1.Color := $FFFFFF;
if RadioGroup3.ItemIndex = 1
then Label2.Font.Color := $FFFFFF;
if RadioGroup3.ItemIndex = 0
then Label2.Font.Color := $000000;
if RadioGroup3.ItemIndex = 1
then Label1.Font.Color := $000000;
if RadioGroup3.ItemIndex = 0
then Label1.Font.Color := $FFFFFF;
if RadioGroup3.ItemIndex = 0
then Form2.Color := $000000;
if RadioGroup3.ItemIndex = 1
then Form2.Color := $FFFFFF;
if RadioGroup3.ItemIndex = 0
then Form2.Label1.Font.Color := $FFFFFF;
if RadioGroup3.ItemIndex = 1
then Form2.Label1.Font.Color := $000000;
if RadioGroup3.ItemIndex = 0
then Form2.Label4.Font.Color := $FFFFFF;
if RadioGroup3.ItemIndex = 1
then Form2.Label4.Font.Color := $000000;
if RadioGroup3.ItemIndex = 0
then Form2.Label7.Font.Color := $FFFFFF;
if RadioGroup3.ItemIndex = 1
then Form2.Label7.Font.Color := $000000;
RadioGroup1.Font.Color := Form1.Color;
RadioGroup2.Font.Color := Form1.Color;
RadioGroup3.Font.Color := Form1.Color;
if RadioGroup3.ItemIndex = 1
then Edit1.Color := $FFFFFF;
if RadioGroup3.ItemIndex = 0
then Edit1.Color := $000000;
if RadioGroup3.ItemIndex = 0
then Edit1.Font.Color := $FFFFFF;
if RadioGroup3.ItemIndex = 1
then Edit1.Font.Color := $000000;
if RadioGroup3.ItemIndex = 0
then Form3.Color := $000000;
if RadioGroup3.ItemIndex = 1
then Form3.Color := $FFFFFF;
end;
procedure TForm1.Image3Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.Image4Click(Sender: TObject);
begin
Application.Minimize;
end;
end.