Why the transparency of a PNG image is lost when I use TPicture?
问题 I'm using this code to convert a transparent png to a 32 bpp bmp. var Picture : TPicture; BMP : TBitmap; begin Picture := TPicture.Create; try Picture.LoadFromFile('Foo.png'); BMP := TBitmap.Create; try BMP.PixelFormat:=pf32bit; BMP.Width := Picture.Width; BMP.Height := Picture.Height; BMP.Canvas.Draw(0, 0, Picture.Graphic); BMP.SaveToFile('Foo.bmp'); finally BMP.Free; end; finally Picture.Free; end; end; The image is converted to bmp but the transparency is lost, what I'm missing? 回答1: Try