1 | unit Os.Graphics;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Os.Types;
|
---|
7 |
|
---|
8 | type
|
---|
9 | TColor = Integer;
|
---|
10 |
|
---|
11 | { TCanvas }
|
---|
12 |
|
---|
13 | TCanvas = class
|
---|
14 | procedure DrawLine(P1, P2: TPosition; Color: TColor); virtual;
|
---|
15 | procedure DrawFrame(Rect: TRectangle; Color: TColor); virtual;
|
---|
16 | procedure DrawArea(Rect: TRectangle; Color: TColor); virtual;
|
---|
17 | procedure DrawText(P: TPosition; Color: TColor; Text: string); virtual;
|
---|
18 | function GetTextSize(Text: string): TSize; virtual;
|
---|
19 | end;
|
---|
20 |
|
---|
21 | const
|
---|
22 | clBlack = $000000;
|
---|
23 | clGray = $808080;
|
---|
24 | clWhite = $ffffff;
|
---|
25 |
|
---|
26 |
|
---|
27 | implementation
|
---|
28 |
|
---|
29 | { TCanvas }
|
---|
30 |
|
---|
31 | procedure TCanvas.DrawLine(P1, P2: TPosition; Color: TColor);
|
---|
32 | begin
|
---|
33 | end;
|
---|
34 |
|
---|
35 | procedure TCanvas.DrawFrame(Rect: TRectangle; Color: TColor);
|
---|
36 | begin
|
---|
37 | with Rect do begin
|
---|
38 | DrawLine(Position, Position + TPosition.Create(Size.Width, 0), Color);
|
---|
39 | DrawLine(Position + TPosition.Create(Size.Width, 0), Position + TPosition.Create(Size.Width, Size.Height), Color);
|
---|
40 | DrawLine(Position + TPosition.Create(Size.Width, Size.Height), Position + TPosition.Create(0, Size.Height), Color);
|
---|
41 | DrawLine(Position + TPosition.Create(0, Size.Height), Position, Color);
|
---|
42 | end;
|
---|
43 | end;
|
---|
44 |
|
---|
45 | procedure TCanvas.DrawArea(Rect: TRectangle; Color: TColor);
|
---|
46 | begin
|
---|
47 | end;
|
---|
48 |
|
---|
49 | procedure TCanvas.DrawText(P: TPosition; Color: TColor; Text: string);
|
---|
50 | begin
|
---|
51 | end;
|
---|
52 |
|
---|
53 | function TCanvas.GetTextSize(Text: string): TSize;
|
---|
54 | begin
|
---|
55 | Result := TSize.Create(0, 0);
|
---|
56 | end;
|
---|
57 |
|
---|
58 |
|
---|
59 | end.
|
---|
60 |
|
---|