如何在Delphi TImageList 中使用 透明 png 图标

来源:互联网 发布:重生之星际淘宝主百度 编辑:程序博客网 时间:2024/04/29 03:45

前一段时间写一个程序,ImageList中添加PNG图片,Toolbar引用ImageList中的PNG图片时,图片背景是黑色,

其实只要设置ImageList的一个属性:ColorDepth设置成cd32Bit就可以了。

 

2010-11-29 17:06

[转] 如何在Delphi TImageList 中使用 透明 png 图标

原文标题:How to use transparent PNG icons with Delphi ImageList

原文:http://www.aha-soft.com/faq/delphi-imagelist-png.htm

Query: "Embarcadero Delphi ImageList does not show transparent PNG icons correctly. How to fix it?".

Solution: If you want to use 32-bit (24-bit + alpha channel) PNG icons within Delphi TImageList, you need to set the following property values for TImageList.DrawingStyle: dsTransparent
ColorDepth: cd32Bit

#皮肤界面

 

原创粉丝点击