diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-09-21 17:21:31 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-09-21 17:21:31 +0100 |
commit | 3c445397b71a42bfeb5c13847a13d408ac6bcc0b (patch) | |
tree | a6481d81b7b54e7e4f3fcd6643787c60dea4ed8c /src/corelib | |
parent | 5affa7cc1bfeafd97ae060ae8b068354cef18af5 (diff) | |
download | fpGUI-3c445397b71a42bfeb5c13847a13d408ac6bcc0b.tar.xz |
gdi: corrected the WinColorTofpgColor() implementation.
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/gdi/fpg_gdi.pas | 11 |
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; |