summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-09-21 17:21:31 +0100
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-09-21 17:21:31 +0100
commit3c445397b71a42bfeb5c13847a13d408ac6bcc0b (patch)
treea6481d81b7b54e7e4f3fcd6643787c60dea4ed8c /src
parent5affa7cc1bfeafd97ae060ae8b068354cef18af5 (diff)
downloadfpGUI-3c445397b71a42bfeb5c13847a13d408ac6bcc0b.tar.xz
gdi: corrected the WinColorTofpgColor() implementation.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/gdi/fpg_gdi.pas11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas
index c6fbe477..5d20873d 100644
--- a/src/corelib/gdi/fpg_gdi.pas
+++ b/src/corelib/gdi/fpg_gdi.pas
@@ -380,9 +380,16 @@ begin
end;
function WinColorTofpgColor(col: longword): TfpgColor;
+var
+ t: TRGBTriple;
begin
- //swapping bytes
- Result := fpgColorToWin(col);
+ { Windown Color is BBGGRR format }
+ t.Blue := (col and $FF0000) shr 16;
+ t.Green := (col and $00FF00) shr 8;
+ t.Red := (col and $0000FF);
+ t.Alpha := $FF;
+
+ Result := RGBTripleTofpgColor(t);
end;
function GetMyWidgetFromHandle(wh: TfpgWinHandle): TfpgWidget;