1

In my Delphi XE3 Application I've placed a TPageControl component into the MainForm. I linked its "Images" property to a ImageList which contains some PNG images. At design time when I set the "Image Index" properties of each TTabSheet the images are correctly represented. Otherwise, when I run the application I see that all the images contained in the TTabSheet (which should be without background) are surrounded by a black squared area. I check the settings of my ImageList and I see that:

  • -BkColor: clNone
  • -BlendColor: clNone
  • -ColorDepth: cd32bit
  • -DrawingStyle: dsTransparent
  • -ImageType: itImage
  • -Masked: False


I don't know whether it will be relevant to the problem but I note that changing the settings of the Project and enabling the voice "Enable runtime theme" this problem is solved.

Thanks.

stacker
  • 603
  • 4
  • 10
  • 15
  • 1
    Well, you already mentioned the solution. – Uwe Raabe Jun 28 '13 at 13:06
  • I have to create an Application for older version of Windows that doesn't support themes. – stacker Jun 28 '13 at 13:10
  • 1
    That's the image list's fault. – TLama Jun 28 '13 at 13:21
  • In that case you can try TPngImageList that comes with PngComponents. CodeCentral Item 26127: http://cc.embarcadero.com/Item/26127 – Uwe Raabe Jun 28 '13 at 13:50
  • "older version of Windows that doesn't support themes" - Not with XE3, I don't think. If it doesn't support themes, it's probably not going to support Unicode. – Ken White Jun 28 '13 at 16:27
  • @KenWhite Runtime themes are for XP and up, I believe, while Windows offers unicode support since Windows 95 using [unicode layers](https://en.wikipedia.org/wiki/Microsoft_Layer_for_Unicode) and since Windows 2000 built in. – GolezTrol Jun 28 '13 at 16:38
  • @GolezTrol: XE3 doesn''t officially support XP, and MS is dropping support for it finally as well; support for Win2K was discontinued long ago. But luckily I didn't say "won't" :-) But I stand corrected - thanks for the info. I knew about Win2K, but not 95. I doubt this will be the only issue, though; differences in ComCtl are going to cause issues with the ImageList itself as well if it's loaded at designtime, and there are quite likely other problem areas. – Ken White Jun 28 '13 at 16:44
  • 1
    @stacker, either keep Windows themes enabled (which will preserve transparency of the image lists thanks to using the newer version of Comctl), or you can try to temporarily use that newer version of ComCtl as suggested in the second paragraph of [`this answer`](http://stackoverflow.com/a/9938145/960757). – TLama Jun 28 '13 at 16:59
  • @GolezTrol NT has always been a Unicode OS, right back to the original version, NT3.5 – David Heffernan Jun 29 '13 at 09:55
  • @KenWhite XE3 (and XE4) have full support for producing apps that target XP. They dropped support for w2k a few releases ago. They don't support running the IDE on XP, but that's a different topic. It would be suicide to release a dev tool that could not target XP. Look what happened when MS tried that with the original release of VS2012. – David Heffernan Jun 29 '13 at 09:58

0 Answers0