Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Graphics32


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: May 9, 2017 2:31 AM Last Post By: Mark van der Ey... Threads: [ Previous | Next ]
Mark van der Ey...

Posts: 3
Registered: 4/21/09
Graphics32  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 8, 2017 12:17 AM
I need a graphics32 ImgView to be 'on top of' several other components, so that the transparent parts of the ImgView will show what's underneath.

This works just fine for a TPanel, but for a TImage, or even a TImage32 it's as though they are simply not there, the underlying TPanel shows.

How can I fix this?
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Graphics32  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 8, 2017 7:55 AM   in response to: Mark van der Ey... in response to: Mark van der Ey...
Mark van der Eynden wrote:

I need a graphics32 ImgView to be 'on top of' several other
components, so that the transparent parts of the ImgView will show
what's underneath.

This works just fine for a TPanel, but for a TImage, or even a
TImage32 it's as though they are simply not there, the underlying
TPanel shows.

How can I fix this?

Basically you cannot. The image controls are TGraphicControl
descendents, which simply do not exist for Windows since they do not
have a window handle. They can fill the client area of a specific
TWinControl descendent (like a panel) that is their Parent control (the
VCL has build-in support for that), but they cannot be on top of other
TWinControls that are not their Parent.

Of course you can use a panel with ParentBackground set to true to
cover the other controls and use that panel as Parent for the image,
but that will, for example, block any mouse input to the controls
covered by the panel.

You may be trying the solve the actual problem you have the wrong way.
What do you want to achieve here? How would the user interact with the
result?

--
Peter Below
TeamB
Mark van der Ey...

Posts: 3
Registered: 4/21/09
Re: Graphics32  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 8, 2017 2:00 PM   in response to: Mark van der Ey... in response to: Mark van der Ey...
I suspected as much, I'll have to copy the underlying 'picture' into the base of the ImgView, messy but necessary, I guess.

Thanks,

Um, so how does the IDE do it at design time?
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Graphics32  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 8, 2017 11:02 PM   in response to: Mark van der Ey... in response to: Mark van der Ey...
Mark van der Eynden wrote:

I suspected as much, I'll have to copy the underlying 'picture' into
the base of the ImgView, messy but necessary, I guess.

Thanks,

Um, so how does the IDE do it at design time?

Does what? ParentBackground is true by default, which causes controls
to ask their parent to paint themselves to the control canvas...

--
Peter Below
TeamB
Mark van der Ey...

Posts: 3
Registered: 4/21/09
Re: Graphics32  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 9, 2017 2:31 AM   in response to: Peter Below in response to: Peter Below
I was going to say how does the designer in the IDE appear to show everything correctly, but now that I see it doesn't.

Neither timage nor timgview32 have ParentBackground, so I can't use that anyway
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02