mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 10:19:13 +02:00
wince: fix CreateDIBSectionFromDescription for mono bitmaps (#0011911)
git-svn-id: trunk@16362 -
This commit is contained in:
parent
5ed7fa3a72
commit
7712fe3795
@ -731,11 +731,18 @@ begin
|
||||
then Info.Header.biCompression := BI_BITFIELDS
|
||||
else Info.Header.biCompression := BI_RGB;
|
||||
|
||||
// when 24bpp, CE only supports B8G8R8 encoding
|
||||
// TODO: check the description
|
||||
Info.Colors[0] := GetMask(ADesc.RedPrec, ADesc.RedShift);
|
||||
Info.Colors[1] := GetMask(ADesc.GreenPrec, ADesc.GreenShift);
|
||||
Info.Colors[2] := GetMask(ADesc.BluePrec, ADesc.BlueShift);
|
||||
if ADesc.BitsPerPixel = 1
|
||||
then begin
|
||||
// mono bitmap: first color is black, second is white
|
||||
Info.Colors[1] := $FFFFFFFF;
|
||||
end
|
||||
else begin
|
||||
// when 24bpp, CE only supports B8G8R8 encoding
|
||||
// TODO: check the description
|
||||
Info.Colors[0] := GetMask(ADesc.RedPrec, ADesc.RedShift);
|
||||
Info.Colors[1] := GetMask(ADesc.GreenPrec, ADesc.GreenShift);
|
||||
Info.Colors[2] := GetMask(ADesc.BluePrec, ADesc.BlueShift);
|
||||
end;
|
||||
|
||||
// Use createDIBSection, since only devicedepth bitmaps can be selected into a DC
|
||||
// when they are created with createDIBitmap
|
||||
|
Loading…
Reference in New Issue
Block a user