Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PngToIcon24 :: ColorBitmap.PixelFormat := pf32bit ?? #8

Open
unununununununun opened this issue Jan 21, 2022 · 1 comment
Open

PngToIcon24 :: ColorBitmap.PixelFormat := pf32bit ?? #8

unununununununun opened this issue Jan 21, 2022 · 1 comment

Comments

@unununununununun
Copy link

unununununununun commented Jan 21, 2022

Hello. there is definitely no error, is the PixelFormat correct pf32bit?

→ ColorBitmap.PixelFormat := pf32bit; ??

If I set the pf24bit, then Bitmap looks correct, if pf32bit, then draws with glitches.

function PngToIcon24(Png: TPngImage; Background: TColor): HIcon;
var
ColorBitmap, MaskBitmap: TBitmap;
X, Y: Integer;
AlphaLine: PByteArray;
IconInfo: TIconInfo;
TransparencyColor: TColor;
begin
ColorBitmap := TBitmap.Create;
MaskBitmap := TBitmap.Create;
try
ColorBitmap.Width := Png.Width;
ColorBitmap.Height := Png.Height;
ColorBitmap.PixelFormat := pf32bit; <<<<<<<<<<<<<<<<<<<<<<<< (may be pf24bit ??)
MaskBitmap.Width := Png.Width;
MaskBitmap.Height := Png.Height;
MaskBitmap.PixelFormat := pf32bit; <<<<<<<<< (may be pf1bit ??)
...
...

@romankassebaum
Copy link
Contributor

You you please ask Uwe Raabe. He has originally written this library. I guess he knows better what is going on here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants