source: branches/overos/Os.Graphics.pas

Last change on this file was 39, checked in by chronos, 11 months ago
  • Modified: Simplified unit names.
File size: 1.4 KB
Line 
1unit Os.Graphics;
2
3interface
4
5uses
6 Classes, SysUtils, Os.Types;
7
8type
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
21const
22 clBlack = $000000;
23 clGray = $808080;
24 clWhite = $ffffff;
25
26
27implementation
28
29{ TCanvas }
30
31procedure TCanvas.DrawLine(P1, P2: TPosition; Color: TColor);
32begin
33end;
34
35procedure TCanvas.DrawFrame(Rect: TRectangle; Color: TColor);
36begin
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;
43end;
44
45procedure TCanvas.DrawArea(Rect: TRectangle; Color: TColor);
46begin
47end;
48
49procedure TCanvas.DrawText(P: TPosition; Color: TColor; Text: string);
50begin
51end;
52
53function TCanvas.GetTextSize(Text: string): TSize;
54begin
55 Result := TSize.Create(0, 0);
56end;
57
58
59end.
60
Note: See TracBrowser for help on using the repository browser.