source: trunk/Packages/bgracontrols/testbgracontrols/uioselements.pas

Last change on this file was 2, checked in by chronos, 5 years ago
File size: 1.3 KB
Line 
1unit uioselements;
2
3{$mode objfpc}{$H+}
4
5interface
6
7uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
9 BGRABitmap, BGRABitmapTypes, BGRASamples;
10
11type
12
13 { TfrmiOSElements }
14
15 TfrmiOSElements = class(TForm)
16 procedure FormCreate(Sender: TObject);
17 procedure FormDestroy(Sender: TObject);
18 procedure FormPaint(Sender: TObject);
19 procedure FormResize(Sender: TObject);
20 private
21 { private declarations }
22 public
23 { public declarations }
24 bitmap: TBGRABitmap;
25 end;
26
27var
28 frmiOSElements: TfrmiOSElements;
29
30implementation
31
32{$R *.lfm}
33
34{ TfrmiOSElements }
35
36procedure TfrmiOSElements.FormCreate(Sender: TObject);
37begin
38 bitmap := TBGRABitmap.Create(Width, Height);
39end;
40
41procedure TfrmiOSElements.FormDestroy(Sender: TObject);
42begin
43 bitmap.Free;
44end;
45
46procedure TfrmiOSElements.FormPaint(Sender: TObject);
47begin
48 bitmap.Draw(Canvas, ClientRect);
49end;
50
51procedure TfrmiOSElements.FormResize(Sender: TObject);
52var
53 temp: TBGRABitmap;
54begin
55 bitmap.SetSize(Width, Height);
56
57 temp := DrawiOSElement(Width, Height, iOSBackground);
58 bitmap.Fill(temp);
59 temp.Free;
60
61 temp := DrawiOSElement(Width, 22, iOSBar);
62 bitmap.PutImage(0, 0, temp, dmSet);
63 temp.Free;
64
65 temp := DrawiOSElement(Width, 49, iOSToolBar);
66 bitmap.PutImage(0, 22, temp, dmDrawWithTransparency);
67 temp.Free;
68end;
69
70end.
71
Note: See TracBrowser for help on using the repository browser.