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