Transparent PNG image (with TImageList) in a TMainMenu

后端 未结 3 1526
离开以前
离开以前 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 15:02

    Set the following property values for TImageList: DrawingStyle: dsTransparent ColorDepth: cd32Bit

    Application->Enable runtime themes:= true; (Proj Settings).


    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 first.

提交回复
热议问题