diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-03-15 18:33:18 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-03-15 18:33:18 +0200 |
commit | 71b167bdbc89bf57f2bbba324fb70150371a9c27 (patch) | |
tree | 0d4ca0a5ea178f88e931bd27d9fd094bfff2c8bf /src/corelib | |
parent | 00a414548d158932704bab15dcad259bf7c9b13c (diff) | |
download | fpGUI-71b167bdbc89bf57f2bbba324fb70150371a9c27.tar.xz |
wuline demo fixed regarding TRGBTriple and Alpha channel usage.
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/fpg_wuline.pas | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/fpg_wuline.pas b/src/corelib/fpg_wuline.pas index cfed0a73..7dc3580d 100644 --- a/src/corelib/fpg_wuline.pas +++ b/src/corelib/fpg_wuline.pas @@ -44,7 +44,7 @@ type // Blend a pixel with the current colour procedure AlphaBlendPixel(ACanvas: TfpgCanvas; X, Y: integer; R, G, B: word; ARatio: Double); var - LBack, LNew: TFPColor; + LBack, LNew: TRGBTriple; LMinusRatio: Double; begin if (X < 0) or (X > TCanvasHack(ACanvas).FWindow.Width - 1) or (Y < 0) or @@ -52,11 +52,12 @@ begin Exit; // clipping LMinusRatio := 1 - ARatio; - LBack := fpgColorToFPColor(ACanvas.Pixels[X, Y]); + LBack := fpgColorToRGBTriple(ACanvas.Pixels[X, Y]); LNew.Blue := round(B*ARatio + LBack.Blue*LMinusRatio); LNew.Green := round(G*ARatio + LBack.Green*LMinusRatio); LNew.Red := round(R*ARatio + LBack.Red*LMinusRatio); - ACanvas.Pixels[X, Y] := FPColorTofpgColor(LNew); + LNew.Alpha := 255; + ACanvas.Pixels[X, Y] := RGBTripleTofpgColor(LNew); end; // Draw a anti-aliased line |