diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-03-20 00:31:22 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-03-20 00:31:22 +0200 |
commit | 09917657d8ca27602cf840b7c50559babc21c4b9 (patch) | |
tree | fb5717c67fe9cfba74850bb9d25d438f181f6c91 | |
parent | 6660ef5558039abecc0a009b105465c51900583b (diff) | |
download | fpGUI-09917657d8ca27602cf840b7c50559babc21c4b9.tar.xz |
BMP and PNG image loading now correctly sets the Alpha channel values.
-rw-r--r-- | src/corelib/fpg_imgfmt_bmp.pas | 2 | ||||
-rw-r--r-- | src/corelib/fpg_imgfmt_png.pas | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/fpg_imgfmt_bmp.pas b/src/corelib/fpg_imgfmt_bmp.pas index f678b79b..353b3216 100644 --- a/src/corelib/fpg_imgfmt_bmp.pas +++ b/src/corelib/fpg_imgfmt_bmp.pas @@ -296,7 +296,7 @@ begin Inc(p); pdest^ := pdest^ or (longword(p^) shl 8); Inc(p); - pdest^ := pdest^ or (longword(p^) shl 16); + pdest^ := pdest^ or (longword(p^) shl 16) or ($FF shl 24) {alpha set to full opaque}; Inc(p); Inc(pdest); Inc(pixelcnt); diff --git a/src/corelib/fpg_imgfmt_png.pas b/src/corelib/fpg_imgfmt_png.pas index e4a46a7d..49f3e12c 100644 --- a/src/corelib/fpg_imgfmt_png.pas +++ b/src/corelib/fpg_imgfmt_png.pas @@ -68,7 +68,7 @@ begin for j := 0 to xlocal - 1 do begin colorA := imga.Colors[j, i]; - colorB := (colorA.Blue shr 8) or (colorA.Green and $FF00) or ((colorA.Red and $FF00) shl 8); + colorB := (colorA.Blue shr 8) or (colorA.Green and $FF00) or ((colorA.Red and $FF) shl 16) or ((colorA.Alpha and $FF) shl 24); imgb.Colors[j, i] := colorB; end; imgb.UpdateImage; |