Question

I have PNG icons for my Delphi XE3 application toolbar that, when added to a TActionToolbar via a TImageList, the alpha channel renders darker than it should, causing the icons to look bad. I think the issue has to do with the TImageList and not something specifically with the TActionToolbar.

Photoshop mockup:

Photoshop mockup

Actual look after importing to TActionToolbar (alpha is darker blue for the folder fill):

Actual

Here are my Delphi Object Inspector settings for the TImageList (no, the issue is not the BlendColor property):

TImageList Object Inspector

Is there a way to get Delphi/Windows/whoever the culprit is to render the alpha channel properly? An option is to make the icons all bitmaps, but I'd rather not go through the headache of editing bitmaps with a transparent color because, well, I'd rather not revert to the days of the dinosaurs... TIA.

Was it helpful?

Solution

The best way I found to deal with this is to paint the background color of your Delphi toolbar (or whatever UI element) underneath every pixel that contains transparency in Photoshop before saving the PNG image. This way, the toolbar icons are totally opaque except for the 100% transparent pixels, so there is no alpha blending that takes place--and hence no ugliness.

Use RRUZ's code here to make the disabled toolbar icons look better.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top