Forum > WinCE

TImage and z-order (LCL)


Probably, this is not only WinCE related, but I just tried to use "advanced" TImage, but with no success. What I want to do is to put TImage on top off all components in e.g. TPanel...

So, I have one "full screen" Panel1 TPanel (alClient in the form), one smaller TPanel (alTop of the previous Panel1) and one TListBox (alClient in Panel1).
What I want to do is to put (and see in run-time) an TImage, absolutely positioned in upper left corner of Panel1... of course, it is not visible when put in Panel1, since Panel2 (top aligned) overwrites it.

What would be the right way to do that?
I tried coding (onCreate of the form), .BringToFront on TImage etc., but it is always overwritten by Panel2 and ListBox (height of the image is higher than height of top-aligned panel, so that image should be partialy over both panel2 and Listbox.

Is it possible at all?

That doesn't sounds to me like an z-oder issue. Make sure that your image is redrawn properly. Another solution may be the creation of that image with parent set.

--- Code: ---Image1:=TImage.Create(Panel1);
--- End code ---


--- Quote from: mmikac on January 03, 2010, 12:42:53 am ---Is it possible at all?

--- End quote ---

TImage is derived from TGraphicControl
It can only "live" in the context of its parent.
So it is not directly possible, but if you put your Timage into a TPanel, then it should be possibel to move this panel including the image above other components.

hm, yes. that is possible (because of TPanel), but transparency won't work. I will check if panel can be transparent...

I thought it may be done when TForm is parent of TImage, and setting Z-order/Bring to front, but this "trick" doesn't work.


[0] Message Index

Go to full version