3
votes

i recently got my hands on Delphi 10.2 Tokyo and started to migrate a project made with Delphi XE4. While my application works as before, i have a strange problem with the images saved in a TImageList. This image list is connected to a TCategoryButtons group. The image list holds 16x16px transparent PNG files. The goal of showing the images transparent in the panel works during design time, but not during runtime any more. During runtime, black appears where the image was transparent before.

enter image description here

  • The TImageList has these settings:

    BkColor=clNone, BlendColor=clNone, ColorDepth=32bit, DrawingStyle=dsTransparent

  • The application uses themes

What i tried:

  • Cleaning and rebuilding the whole project
  • making changes to the image list contents (added/removed images)
  • tried different settings in the image list
  • Made a new project, added TCategoryPanel and TImageList, loaded the same images and settings, added a theme -> This works O.O

Did someone had these effects before and knows how to resolve them? Why does this work while in design time, but not in runtime?

1
Transparent PNGs are actually not as you expect. It doesn't use the transparency as found in PNGs. Instead, use a solid color and set that color as the transparent color on the image list.Jerry Dodge
@JerryDodge I would accept his if it would behave the same way during design and runtime - if this is the error case. But because it worked before and works if i create a new project, this has to be something project-related.JP_dev
The latest update of Tokyo has a TPngImageList that seems to work correctly.Ron Maupin
I have Version 25.0.29039.2004 is this the latest update? Is there an update feature i miss?JP_dev
Does your version have a TPngImageList? You can use that instead of the TImageList.Ron Maupin

1 Answers

1
votes

I solved my problems by analyzing the differences between a freshly created project file and my existing. I recreated the .dproj file by deleting it and then reapplied my old changes manually per Project - Options. This fixed my problems with the images.