Delphi-Projects
62 строки · 1.3 Кб
1unit FullScreen;
2
3interface
4
5uses
6Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7ExtCtrls;
8
9type
10TFullScreenForm = class(TForm)
11Image: TImage;
12procedure FormCreate(Sender: TObject);
13procedure ImageMouseDown(Sender: TObject; Button: TMouseButton;
14Shift: TShiftState; X, Y: Integer);
15procedure FormKeyPress(Sender: TObject; var Key: Char);
16private
17{ Private declarations }
18public
19{ Public declarations }
20end;
21
22//function FullScreenPreview(Bitmap: TBitmap): Integer;
23var
24FullScreenForm: TFullScreenForm;
25
26implementation
27
28{$R *.DFM}
29
30{function FullScreenPreview(Bitmap: TBitmap): Integer;
31var
32FullScreenForm: TFullScreenForm;
33begin
34FullScreenForm := TFullScreenForm.Create(Application);
35try
36FullScreenForm.Image.Picture.Bitmap.Assign(Bitmap);
37Result := FullScreenForm.ShowModal;
38finally
39FullScreenForm.Free;
40end;
41end;
42}
43
44procedure TFullScreenForm.FormCreate(Sender: TObject);
45begin
46SetBounds(0, 0, Screen.Width, Screen.Height);
47end;
48
49procedure TFullScreenForm.ImageMouseDown(Sender: TObject;
50Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
51begin
52if Button = mbRight then
53Close;
54end;
55
56procedure TFullScreenForm.FormKeyPress(Sender: TObject; var Key: Char);
57begin
58if Key = #27 then
59Close;
60end;
61
62end.
63