Delphi-Projects

Форк
0
/
FullScreen.pas 
62 строки · 1.3 Кб
1
unit FullScreen;
2

3
interface
4

5
uses
6
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7
  ExtCtrls;
8

9
type
10
  TFullScreenForm = class(TForm)
11
    Image: TImage;
12
    procedure FormCreate(Sender: TObject);
13
    procedure ImageMouseDown(Sender: TObject; Button: TMouseButton;
14
      Shift: TShiftState; X, Y: Integer);
15
    procedure FormKeyPress(Sender: TObject; var Key: Char);
16
  private
17
    { Private declarations }
18
  public
19
    { Public declarations }
20
  end;
21

22
//function FullScreenPreview(Bitmap: TBitmap): Integer;
23
var
24
  FullScreenForm: TFullScreenForm;
25

26
implementation
27

28
{$R *.DFM}
29

30
{function FullScreenPreview(Bitmap: TBitmap): Integer;
31
var
32
  FullScreenForm: TFullScreenForm;
33
begin
34
  FullScreenForm := TFullScreenForm.Create(Application);
35
  try
36
    FullScreenForm.Image.Picture.Bitmap.Assign(Bitmap);
37
    Result := FullScreenForm.ShowModal;
38
  finally
39
    FullScreenForm.Free;
40
  end;
41
end;
42
}
43

44
procedure TFullScreenForm.FormCreate(Sender: TObject);
45
begin
46
  SetBounds(0, 0, Screen.Width, Screen.Height);
47
end;
48

49
procedure TFullScreenForm.ImageMouseDown(Sender: TObject;
50
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
51
begin
52
  if Button = mbRight then
53
    Close;
54
end;
55

56
procedure TFullScreenForm.FormKeyPress(Sender: TObject; var Key: Char);
57
begin
58
  if Key = #27 then
59
    Close;
60
end;
61

62
end.
63

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.