Search code examples
transparencyc++buildertimagelistc++builder-10.1-berlin

Migrated C++ Builder project lose Imagelist transparency


I Upgraded from C++ Builder XE7 to C++ Builder Berlin and I have a project with about 100 images in 6 ImageList controls.

In XE7 the transparency worked fine, but after the upgrade all images now have a black solid background instead of transparency.

I double checked that the ImageList's ColorDepth still was cd32bit, and it is. Everything looks file in the IDE, images are transparent, but as soon I run my application, all images have a black background instead of transparency.

Black background

I tried to drop a new TImageList, cd32bit depth and added some transparent PNG:s that worked fine in XE7. Still they show up with a black background in Runtime, but not in the IDE.


Solution

  • Finally figured it out!
    I noted that all controls had the old Win XP style so I suspected that the wrong version of Comctl32.dll was loaded, the question was only how to change it?

    The project is very old and was created before C++ Builder supported manifests. But in the project options, under Application you will find a section named "Manifest File".

    Set it to "Auto Generate" and tick the checkbox "Enable Runtime Themes" and it will use the correct version of Comctl32.dll