Transparent PNG image (with TImageList) in a TMainMenu

后端 未结 3 1529
离开以前
离开以前 2021-02-05 14:01

I want to load a PNG with transparent background in a TImageList and use it in a TMainMenu (via TAction).
However, in Delphi the background is just black. Is PNG support onl

3条回答
  •  悲&欢浪女
    2021-02-05 14:53

    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.

提交回复
热议问题