Using Transparent PNG with AdvGlowButton/ImageList

Hi,


I'm trying to load transparent PNG into a TImageList, assign that to an AdvGlowButton using the ImageIndex property.

It appears TImageList does not support transparent PNG properly. It will load a PNG but appears to convert it to a bitmask and bitmap and does not preserve the transparency properly.

I can use the Picture property of the AdvGlowButton to load the PNG and it will render it properly but I have 900+ forms in my app and I want all buttons point back to a single TImageList image repository referenced by the ImageIndex so I only have to update the image once. I don't want to go through all these forms and manually load the PNG into each button as this creates a maintenance nightmare.

Is there any conceivable way of achieving this with AdvGlowButton?
Is there a simple way to extend AdvGlowButton to support say a TGDIPictureContainer with a PictureName, HotPictureName and DisabledPictureName or is there another better suited button I can use on AdvToolBar?

Regards
Adam

By the way the TImageList is set to cd32Bit and dsTransparent so it loads the PNG but it doesn't store it internally correctly.

I can assign the AdvGlowButton Picture at runtime from the picture container like this:

   Gdippicturecontainer::TPictureItem *item = GDIPPictureContainer1->Items->Items[0];
   TAdvGDIPPicture *picture = item->Picture;

   TMemoryStream *stream = new TMemoryStream();
   picture->SaveToStream(stream);
   AdvGlowButton1->Picture->LoadFromStream(stream);
   delete stream;
 
Messy! Is there a better solution?

Hi,

had the same issue yesterday. I solved it using a TPngImageList due to Delphi 2006 does not support cd32bit.

Here you can find the PNGImageList: https://code.google.com/p/cubicexplorer/downloads/detail?name=PngComponents.zip&can=2&q=

Regards,
Tiemo

Thanks Tiemo, I did have a look at that component but couldn't get it to compile under Delphi XE6 and don't know enough pascal to know how to fix it. What version are you using?

Found an XE6 install package and got it installed in C++Builder XE6. At first glance it seems to work. Will see how I go with it.