Transparent PNG image (with TImageList) in a TMainMenu

There's no reason to backup whole DFM file.

Before doing something to your ImageList you should export your images: click the "Export" button in the image list editor and it will save all images to a single .BMP file.

After changing properties: ColorDepth = cd32Bit, DrawingStyle = dsTransparent

You should click "Add" button and select the file you previously exported. Then, images will be drawn with transparency in the menu and toolbars (on D2010 at least)... No need to use 3rd party components.


I had been using TPngComponents since Delphi 7. That provide very good png support for most of the delphi build-in / third party components. Embarcadero had purchased another well know Open Sources PNG Supporting component know as TPngImage and build into Delphi's native graphic support in later Delphi versions. So when I changed to Delphi 2010, I think Delphi had native support now and test out the native support but find that the alpha support is not good enough.

So I had used back that TPngComponents again and it had better support for most components, including main menu. I think that package should be usable to DXE with limited modification.

edit : Thanks for Uwe Raabe for pointing out the product Codegear (now Embarcadero) purchased was another component TPngImage rather then the TPngComponent.


  1. Set the following property values for TImageList:
  • DrawingStyle: dsTransparent
  • ColorDepth: cd32Bit
  • TImageList's editor -> set the 'transparent color' to True
  1. In "Project Settings" under "Application" set "Enable runtime themes".

Update for Delphi Rio:

TImageList must have:

  • BkGColor = clNone
  • BlendColor = clNone,
  • ColorDepth = cd32bit,
  • DrawingStyle = dsTransparent (or) dsNormal,
  • Masked = true.

The images can be loaded from a PNG with transparent bkg color.


Note: Editing some properties of TImageList will delete (without any notice) all existing images in your list. Backup your images (or DFM) first.