简体   繁体   中英

Does the delphi TBitmap support an alpha channel

I'm hearing people say that it is not.

However, I created a TBitmap and cleared the entire area by

For I := 1 to bmp.Width do
  For J := 0 to bmp.Height do
    bmp.canvas.Pixels[I,J]:= $00000000;

Then I drew anti-aliased text onto the bitmap and saved it to file. Upon opening it in gimp it shows the transparency information.

Does anyone have a definitive answer on this and if it does work then more information on how it works? I've tried playing around with the last byte and I'm not getting the expected results when i open it in gimp.

它确实如此,但你必须设置

bmp.PixelFormat := pf32bit;

The Delphi TBitmap is just a wrapper around the Windows BITMAP object. So, yes it does support alpha channels, but clearly you must set the PixelFormat property appropriately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM