2

I'm using Delphi XE.

I added a TAdvGlowButton on my form and added a TImageList with one transparent PNG image as its source for images. When I view the form in the design mode, the button looks exactly right and the image is transparent. However, when I run the program, the background of the image turns to solid black. If I undestood correctly, this is not a bug of the TAdvGlowButton but TImageList.

Is there a way to fix this without using any 3rd party components?

Ville Salonen
  • 2,654
  • 4
  • 29
  • 34
  • 1
    Have you set the image list `ColorDepth` property to `cd32bit`? I can see a transparent image for a PNG image, held in an image list, and shown as a toolbar button. So I think `TImageList` can handle such images. – David Heffernan Jan 27 '11 at 10:39
  • Yes, ColorDepth is set to cd32bit and DrawingStyle to dsTransparent. – Ville Salonen Jan 27 '11 at 10:47

1 Answers1

7

I solved this by opening the project settings from Project Manager and checked Application -> Enable runtime themes. What kind of silly option is this? When would anyone want to not enable runtime themes?

Ville Salonen
  • 2,654
  • 4
  • 29
  • 34
  • Since the default setting for this option is to be checked, you should be asking your self the question, "When would anyone want to **not** enable runtime themes?" I think you would probably disable runtime themes if you were using other components that did not run when themes were enabled. – David Heffernan Jan 27 '11 at 11:36
  • It might be that the previous developers unchecked that. I'm just taking my first steps with this new codebase. – Ville Salonen Jan 27 '11 at 11:46
  • 3
    It is probably a port from an earlier version of Delphi, where this option was not available. IIRC, the default when upgrading those projects is setting this switch to false. – Uwe Raabe Jan 27 '11 at 12:46