1 | {$IFDEF INCLUDE_USES}
|
---|
2 | {$UNDEF INCLUDE_USES}
|
---|
3 | ,FPImgCanv
|
---|
4 | {$ENDIF}
|
---|
5 |
|
---|
6 | {$IFDEF INCLUDE_INTERFACE}
|
---|
7 | {$UNDEF INCLUDE_INTERFACE}
|
---|
8 | type
|
---|
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 |
|
---|
20 | const
|
---|
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 |
|
---|
45 | function ColorToRGB(c: TColor): TColor; inline;
|
---|
46 | function RGBToColor(R, G, B: Byte): TColor;
|
---|
47 | procedure RedGreenBlue(rgb: TColor; out Red, Green, Blue: Byte); // does not work on system color
|
---|
48 |
|
---|
49 | function GetScreenDPIX: integer;
|
---|
50 | function GetScreenDPIY: integer;
|
---|
51 | {$ENDIF}
|
---|
52 |
|
---|
53 | {$IFDEF INCLUDE_IMPLEMENTATION}
|
---|
54 | {$UNDEF INCLUDE_IMPLEMENTATION}
|
---|
55 | procedure TRawImage.BGRASetSizeAndTransparency(AWidth,AHeight: Integer; ATransparent: boolean);
|
---|
56 | begin
|
---|
57 | SetSize(AWidth,AHeight);
|
---|
58 | end;
|
---|
59 |
|
---|
60 | constructor TRawImage.Create;
|
---|
61 | begin
|
---|
62 | inherited Create(0,0);
|
---|
63 | end;
|
---|
64 |
|
---|
65 | procedure TGUICanvas.DrawImage(x,y: integer; AImage: TFPCustomImage);
|
---|
66 | begin
|
---|
67 | Draw(x,y, AImage);
|
---|
68 | end;
|
---|
69 |
|
---|
70 | function ColorToRGB(c: TColor): TColor; inline;
|
---|
71 | begin
|
---|
72 | result := c;
|
---|
73 | end;
|
---|
74 |
|
---|
75 | function RGBToColor(R, G, B: Byte): TColor;
|
---|
76 | begin
|
---|
77 | Result := (B shl 16) or (G shl 8) or R;
|
---|
78 | end;
|
---|
79 |
|
---|
80 | procedure RedGreenBlue(rgb: TColor; out Red, Green, Blue: Byte);
|
---|
81 | begin
|
---|
82 | Red := rgb and $000000ff;
|
---|
83 | Green := (rgb shr 8) and $000000ff;
|
---|
84 | Blue := (rgb shr 16) and $000000ff;
|
---|
85 | end;
|
---|
86 |
|
---|
87 | function GetScreenDPIX: integer;
|
---|
88 | begin
|
---|
89 | result := 96;
|
---|
90 | end;
|
---|
91 |
|
---|
92 | function GetScreenDPIY: integer;
|
---|
93 | begin
|
---|
94 | result := 96;
|
---|
95 | end;
|
---|
96 |
|
---|
97 | {$ENDIF}
|
---|