 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Owen Guest
|
Posted: Thu May 05, 2005 9:26 pm Post subject: Get backgroud |
|
|
Hello:
I try to develop a transparent button, all work fines but to erase the
button I have to know in what position in the background image is, then cut
one piece of this background image and erase the button with this image.
Then I have development a button that you can move whatever you want and it
know what is the picture or image in it position, then get this piece and
use like I do right now. To do this I have to get, first before paint the
button, the rect of button from background and then paint the button. The
problem is the button paint transparent image. This component is development
with GDI+
Best regards,
Owen.
|
|
| Back to top |
|
 |
Kim Pedersen Guest
|
Posted: Thu May 05, 2005 10:27 pm Post subject: Re: Get backgroud |
|
|
Hi
Not sure what you to try reach to as final result , but take a look on this little
component -(sadman)
It can move and resize components( of anestor of Tcontrol , I think).
http://www.simes.clara.net/delphi/ctrlsize.htm
maybe it can give you some hints.
Br
Kim Pedrsen
Owen wrote:
| Quote: | Hello:
I try to develop a transparent button, all work fines but to erase the
button I have to know in what position in the background image is, then cut
one piece of this background image and erase the button with this image.
Then I have development a button that you can move whatever you want and it
know what is the picture or image in it position, then get this piece and
use like I do right now. To do this I have to get, first before paint the
button, the rect of button from background and then paint the button. The
problem is the button paint transparent image. This component is development
with GDI+
Best regards,
Owen.
|
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Fri May 06, 2005 7:10 pm Post subject: Re: Get backgroud |
|
|
In article <427a8f6e (AT) newsgroups (DOT) borland.com>, Owen wrote:
| Quote: | I try to develop a transparent button, all work fines but to erase the
button I have to know in what position in the background image is, then cut
one piece of this background image and erase the button with this image.
|
If you can base your control on TGraphicsControl you only need to exclude the
csOpaque style from the Controlstyle, that makes the parent paint the area
under the control before the control itself gets painted. See how TLabel
implements transparency.
For a TWincontrol this does not work. Windows does not really support
transparency on the control level. And there simply is *nothing* beneath your
control, if you could pry it off the screen you would create a hole in reality
that would suck in your monitor <g>. Keep in mind that the screen is only one
pixel deep and Windows does not store the image of the control yours covers
anywhere. So transparency like you want it to have cannot be achieved by a
TWincontrol unless the parent it sits on cooperates. By default a Delphi
container control (every TWincontrol in fact) has the WS_CLIPCHILDREN window
style, which makes it exclude the area covered by child controls from any
painting it does. If you remove this style from the parent it will paint the
area under your control as well. If you write a custom container for your
transparent control you can also simply add a method or message handler to it
that allows a child to ask for the image of the area it covers.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|