diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-04-06 02:36:50 +0100 |
---|---|---|
committer | David Laurence Emerson <dle3ab@angelbase.com> | 2013-05-28 00:42:52 -0700 |
commit | 438c1d116b5ab66cb1f787d3a7c3923cc8714e78 (patch) | |
tree | f6dd7b1b1e0977412844768a5ebaec5207dcfb04 /src | |
parent | 00ec6b60e14dd6ccf02f6a341afe61a53584a368 (diff) | |
download | fpGUI-438c1d116b5ab66cb1f787d3a7c3923cc8714e78.tar.xz |
os/2 bitmaps with bitdepth of 1,4 or 8 have a 3 byte color palette.
I originally read it as a 4-byte color palette. This fixes the colors
of images (mostly), but there still seems to be some or other decoding
issues with larger than 65KB images.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/fpg_imgfmt_bmp.pas | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/fpg_imgfmt_bmp.pas b/src/corelib/fpg_imgfmt_bmp.pas index 296e515d..ff354898 100644 --- a/src/corelib/fpg_imgfmt_bmp.pas +++ b/src/corelib/fpg_imgfmt_bmp.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -415,11 +415,12 @@ begin pcol := ppal; pixelcnt := 0; + // OS/2 1.x bitmap with uses 3-byte palette while (p) < (pdata) do begin - pcol^ := (LongWord(p[3]) shl 24) + (LongWord(p[2]) shl 16) + (LongWord(p[1]) shl 8) + LongWord(p[0]); + pcol^ := (LongWord($FF) shl 24) + (LongWord(p[2]) shl 16) + (LongWord(p[1]) shl 8) + LongWord(p[0]); Inc(pcol); - inc(p, 4); + inc(p, 3); Inc(pixelcnt); end; end; |