Board index » delphi » Panel background graphics and transparency -- please help

Panel background graphics and transparency -- please help

I am trying to create enhance the image of a program that I wrote, and got
stuck trying to put a background on a window.  I have a bunch of nested
panels in a window, and was trying to draw a background on one of the
panels.  I tried overriding the Paint method, but that didn't help.  Putting
a separate object on the panel that woud draw a pseudo-background before
other images are drawn doesn't work either -- pretty much all types of
objects will overlay things like labels, not matter what order.

The second problem is making objects transparent.  For example, if I have an
object of a class derived from TCustomPanel, I'd like to make it transparent
so that, let's say, only the border is drawn, and the background object show
through the rest of the panel.  Does anyone have any ideas?

If anyone can help me please email me at den...@deniska.com besides posting
your reply here.  Thanks.

 

Re:Panel background graphics and transparency -- please help


Quote
Dennis Startsev wrote in message <6co5kq$...@eve.enteract.com>...
>I am trying to create enhance the image of a program that I wrote, and got
>stuck trying to put a background on a window.  I have a bunch of nested
>panels in a window, and was trying to draw a background on one of the
>panels.  I tried overriding the Paint method, but that didn't help.
Putting
>a separate object on the panel that woud draw a pseudo-background before
>other images are drawn doesn't work either -- pretty much all types of
>objects will overlay things like labels, not matter what order.

Here we have a custom panel component inheriting from TCustomPanel, and
overriding the Paint method does what we want. We don't call the inherited
Paint method and you should do the same.

Quote

>The second problem is making objects transparent.  For example, if I have
an
>object of a class derived from TCustomPanel, I'd like to make it
transparent
>so that, let's say, only the border is drawn, and the background object
show
>through the rest of the panel.  Does anyone have any ideas?

You must ensure that your foreground  objects windows do nothing when they
receive the WM_ERASEBACKGROUND message. Just override the message
handler.
Quote

>If anyone can help me please email me at den...@deniska.com besides posting
>your reply here.  Thanks.

Re:Panel background graphics and transparency -- please help


Quote
Dennis Startsev wrote in message <6co5kq$...@eve.enteract.com>...
>I am trying to create enhance the image of a program that I wrote, and got
>stuck trying to put a background on a window.  I have a bunch of nested
>panels in a window, and was trying to draw a background on one of the
>panels.  I tried overriding the Paint method, but that didn't help.
Putting
>a separate object on the panel that woud draw a pseudo-background before
>other images are drawn doesn't work either -- pretty much all types of
>objects will overlay things like labels, not matter what order.

>The second problem is making objects transparent.  For example, if I have
an
>object of a class derived from TCustomPanel, I'd like to make it
transparent
>so that, let's say, only the border is drawn, and the background object
show
>through the rest of the panel.  Does anyone have any ideas?

Two Choices:

Money Choice: We sell a complete set of panels, bevels, groups etc. that
support "tiled" images and much more... $25.00 for DCU's Delphi 2 or 3...

Free Choice: (cheat kinda) why not use a TBevel to make tour region, or
TPanel w/ TImage. This is the cheap way out, with overhead... <g>...

Ozz
Warpgroup

Other Threads