In the interest of full disclosure: I ran into a similar problem and used this Q & A to install my initial solution. Since I needed a quick fix for my application and compiler (I use C ++ Builder 2009), I decided to βhackβ the private members of VCL and set Glyphlist ColorDepth to cd32Bit until I had time to work on something more permanent. This hack worked with a few changes, but was far from ideal, for all obvious reasons, but also with functionality, there were problems that should be considered.
However, by doing this, I experimented further and finally came below, a working solution, without any dirty tricks. Not being familiar with the internal development of VCL and rather βit is not possible as it is,β feedback from people who are much deeper in VCL, Iβm a little unsure of what Iβm missing right now !? Because below solution works for me. Confirmed on XP, XP-High-contrast, W7 and W10. The characters do not look good on W2K, but then this is true for the main menu and pop-up icons, so it is.
I am C ++ code, but using the same basic VCL, so I will post my C ++ solution here as an answer to a Delphi question. I hope that everything is in order, in the interests of proposing a path to a solution, and not keeping it to ourselves. Guru Delphi can also convert and publish as an answer if I don't miss something and my decision is not what I needed all the time.
Since I started with the βhackβ approach, I first subclassed TSpeedButton and put the code in the MyTSpeedButton function, but this is not necessary to complete this work. However, this is the code I'm sending:
heading
class MyVCLTSpeedButton : public TSpeedButton { public: __fastcall MyVCLTSpeedButton(Classes::TComponent* AOwner) ; void __fastcall AddGlyphWithAlphaChannel(Imglist::TCustomImageList* ImageList, int UpIndex, int DisabledIndex = -1, int ClickedIndex = -1, int DownIndex = -1) ; };
caste
void __fastcall MyVCLTSpeedButton::AddGlyphWithAlphaChannel(Imglist::TCustomImageList* ImageList, int UpIndex, int DisabledIndex, int ClickedIndex, int DownIndex) { Glyph->Assign(NULL) ;