Board index » cppbuilder » Make part of the Form "Half transparent"

Make part of the Form "Half transparent"


2004-05-15 01:06:57 AM
cppbuilder16
He all,
I'm building an application for my company, one nice feature
that i was thinking about for this application is to build a
form that will include a window on it's upper side, in which i
will display the Logo of my company in such way that you'll be
able to look through it like a window, i don't want to make part
of this window transparent, i know how to do that, what i want
is to make this WHOLE window "half-transparent", that is, that
you can see the Logo but at the same time you could see what
there is under it, just like a reflection of a view on a window,
you can see the view but also what inside the room.
I know that for doing this i have to give each pixel in this
window weighted weight of the pixel in this position of the Logo
and the pixel in this position of the background under the form,
for example i can set each pixel to be 60% color of the logo and
40% color of the background.
Sorry for the long explenation but now come the question - is
there any easy way to do this? what is the best way to do
something like that? it should looks smooth also when the user
move the form from one position to another, i should see the
background moving through the logo window.
Thanks very much for any help :-)
Ramy
 
 

Re:Make part of the Form "Half transparent"

Ramy wrote:
Quote
what i want
is to make this WHOLE window "half-transparent", that is, that
you can see the Logo but at the same time you could see what
there is under it, just like a reflection of a view on a window,
you can see the view but also what inside the room.
This is known as alpha blending. You can do this with
SetLayeredWindowAttributes(). Have a look at
minilien.com/?1ogjXVOBFF.
Take a look at GDI+ as well as it has native support for alpha blending.
If you don't know what GDI+ is or how to use it with BCB, see:
www.leunen.com/cbuilder/gdiplus.html
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
www.leunen.com/
----------------------------------------
 

Re:Make part of the Form "Half transparent"

Thanks!
Michel Leunen < XXXX@XXXXX.COM >wrote:
Quote
Ramy wrote:

>what i want
>is to make this WHOLE window "half-transparent", that is, that
>you can see the Logo but at the same time you could see what
>there is under it, just like a reflection of a view on a window,
>you can see the view but also what inside the room.

This is known as alpha blending. You can do this with
SetLayeredWindowAttributes(). Have a look at
minilien.com/?1ogjXVOBFF.
Take a look at GDI+ as well as it has native support for alpha blending.
If you don't know what GDI+ is or how to use it with BCB, see:
www.leunen.com/cbuilder/gdiplus.html

Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
www.leunen.com/
----------------------------------------
 

{smallsort}