Recent

Author Topic: TImage and z-order (LCL)  (Read 8641 times)

mmikac

  • New Member
  • *
  • Posts: 26
TImage and z-order (LCL)
« on: January 03, 2010, 12:42:53 am »
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?

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: TImage and z-order (LCL)
« Reply #1 on: January 03, 2010, 11:57:27 am »
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: [Select]
Image1:=TImage.Create(Panel1);
Image1.Parent:=Image1;
Image1.Bitmap.LoadFromFile...
Lazarus 1.7 (SVN) FPC 3.0.0

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1901
Re: TImage and z-order (LCL)
« Reply #2 on: January 03, 2010, 12:09:06 pm »
Is it possible at all?

TImage is derived from TGraphicControl http://lazarus-ccr.sourceforge.net/docs/lcl/controls/tgraphiccontrol.html
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.

mmikac

  • New Member
  • *
  • Posts: 26
Re: TImage and z-order (LCL)
« Reply #3 on: January 03, 2010, 01:50:34 pm »
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.

 

TinyPortal © 2005-2018