tags:

views:

230

answers:

1

I'm using Delphi 2006. I have a few PNG images with transparencies and I have to create a GUI using them (top bar, left panel...). The images have different aligns properties. One of the images is the background of the form. The problem here is that I can't align it as alClient because it only occupies the rectangular zone that the other images have left, showing the naked canvas in their transparent zones. What I need is that the background image is put behind all the other images and taking all the canvas size.

Is there anyway to do this? I know I can do this writting some logic in the OnResize event of the form but I was just curious if I was missing something.

Thanks.

+1  A: 

Put a TImage on the form and align it with "alClient". Then put an "alClient" aligned Panel on the form. The TPanel is transparent when themes are enabled and "ParentBackground" property is set. Then put the images on the panel and align them at will. If when themes are not enabled is important, you can use a "TJvPanel" which is part of the JVCL library. A search on google also seems to reveal some code for transparent panels.

The above will not help transparency with the "png"s though. AFAIK png support (transparency) is added with D2009 and I don't know if this support includes TImage.

edit: Actually it appears that I owe the very capability to load png images to TImage to the JVCL library itself, and it seems to support transparent "png"s with TImage just fine.

Sertac Akyuz
Thanks, Sertac. Yours sounds like a good way of solving the problem. I have no problem with the transparent png as I used third parties components to do this.
Averroes