Using D7/themes, I have a TSpeedButton which is a toggle and I need to display 2 different glyphs in a TSpeedButton based on whether the button was clicked or right-clicked, as they do 2 slightly different things.
So I need to assign a glyph to the button at run time, which works, but nothing I do makes the image transparent. There is always a white square with the icon in the middle. It only looks correct if I assign one of the images to the Glyph property at design time. I use a TImageList to store the 2 images, and assign them like this as required. BitMap := TBitMap.Create; ImageList.GetBitmap(n,BitMap); SpeedButton.Glyph := BitMap; BitMap.Free; where n is 0 or 1. I've tried setting Bitmap.Transparent to true and other combinations like TransparentMode and TransparentColor but nothing makes any difference. There is some sort of transparency happening since the images have quite a colorful background but this appears as white on the button. As a test I assigned the image from a filename Button.Glyph.LoadFromFile() and this works correctly and looks good, but I don't want to distribute BMP files separately. A possible alternative I haven't tried is embedding the 2 images as a resource in the EXE file and using Button.Glyph.LoadFromResourceName (or ResourceID), but that seems a lot of work. I thought I would try here to see if anyone knows how to resolve the current method. Cheers, Ross.
_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [email protected] with Subject: unsubscribe
