source: trunk/Packages/bgrabitmap/bgranogui.inc

Last change on this file was 2, checked in by chronos, 5 years ago
File size: 2.3 KB
Line 
1{$IFDEF INCLUDE_USES}
2{$UNDEF INCLUDE_USES}
3,FPImgCanv
4{$ENDIF}
5
6{$IFDEF INCLUDE_INTERFACE}
7{$UNDEF INCLUDE_INTERFACE}
8type
9 TColor = type LongInt;
10 {$warnings off}
11 TRawImage = class(TFPMemoryImage)
12 procedure BGRASetSizeAndTransparency(AWidth,AHeight: Integer; {%H-}ATransparent: boolean);
13 constructor Create;
14 end;
15 {$warnings on}
16 TGUICanvas = class(TFPImageCanvas)
17 procedure DrawImage(x,y: integer; AImage: TFPCustomImage);
18 end;
19
20const
21 clNone = TColor($1FFFFFFF);
22 clDefault = TColor($20000000);
23 clBlack = TColor($000000);
24 clMaroon = TColor($000080);
25 clGreen = TColor($008000);
26 clOlive = TColor($008080);
27 clNavy = TColor($800000);
28 clPurple = TColor($800080);
29 clTeal = TColor($808000);
30 clGray = TColor($808080);
31 clSilver = TColor($C0C0C0);
32 clRed = TColor($0000FF);
33 clLime = TColor($00FF00);
34 clYellow = TColor($00FFFF);
35 clBlue = TColor($FF0000);
36 clFuchsia = TColor($FF00FF);
37 clAqua = TColor($FFFF00);
38 clLtGray = TColor($C0C0C0); // clSilver alias
39 clDkGray = TColor($808080); // clGray alias
40 clWhite = TColor($FFFFFF);
41
42 clRgbBtnHighlight = TColor($E0E0E0);
43 clRgbBtnShadow = TColor($808080);
44
45function ColorToRGB(c: TColor): TColor; inline;
46function RGBToColor(R, G, B: Byte): TColor;
47procedure RedGreenBlue(rgb: TColor; out Red, Green, Blue: Byte); // does not work on system color
48
49function GetScreenDPIX: integer;
50function GetScreenDPIY: integer;
51{$ENDIF}
52
53{$IFDEF INCLUDE_IMPLEMENTATION}
54{$UNDEF INCLUDE_IMPLEMENTATION}
55procedure TRawImage.BGRASetSizeAndTransparency(AWidth,AHeight: Integer; ATransparent: boolean);
56begin
57 SetSize(AWidth,AHeight);
58end;
59
60constructor TRawImage.Create;
61begin
62 inherited Create(0,0);
63end;
64
65procedure TGUICanvas.DrawImage(x,y: integer; AImage: TFPCustomImage);
66begin
67 Draw(x,y, AImage);
68end;
69
70function ColorToRGB(c: TColor): TColor; inline;
71begin
72 result := c;
73end;
74
75function RGBToColor(R, G, B: Byte): TColor;
76begin
77 Result := (B shl 16) or (G shl 8) or R;
78end;
79
80procedure RedGreenBlue(rgb: TColor; out Red, Green, Blue: Byte);
81begin
82 Red := rgb and $000000ff;
83 Green := (rgb shr 8) and $000000ff;
84 Blue := (rgb shr 16) and $000000ff;
85end;
86
87function GetScreenDPIX: integer;
88begin
89 result := 96;
90end;
91
92function GetScreenDPIY: integer;
93begin
94 result := 96;
95end;
96
97{$ENDIF}
Note: See TracBrowser for help on using the repository browser.