Using Borland C++ Builder 2009
I screen-captured three buttons from a W7 Windows dialog and put them in a TImageList. I load the 3 variants in a TImage, when appropriate.
Image->Picture->Bitmap = NULL ; // Clear previous state
ImageList->GetBitmap(2, Image->Picture->Bitmap) ;
PS: Image->Transparent = True
On Windows 7 and Windows 10 this seems to work properly.
BUT I just realized, only because the TForm the TImage is placed on has the exact same background color
. (confirmed not to work after I changed the background to lime)
On Windows XP the button doesn't look so great. Since XP seems to have slightly different background color. Mind you, it's also clBtnFace
I have also experimented with setting BlendColor
and DrawingStyle
of the TImageList control, combined with Image->Transparent = true
or false
.
But I can't get it to work.
I captured the Image->Picture->Bitmap->Canvas->Pixels[0][0]
value on W7 and put it in ImageList->BlendColor
(ImageList->DrawingStyle = dsFocus
or dsSelected
) and so forth, without success.
I also have experimented with explicitly setting Image->Transparent = True
again after a ImageList->GetBitmap(2, Image->Picture->Bitmap)
and even tried
Image->Picture->Bitmap->TransparentColor =
Image->Picture->Bitmap->Canvas->Pixels[0][0]
without a noticeable effect.
Your thoughts ?