简体   繁体   中英

Delphi TImageList PNG alpha renders too dark

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样机

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

实际

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

TImageList对象检查器

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM