[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Creating Movable Truly Transparent C# controls

Dan Noel

12/9/2004 8:17:00 PM


I am looking for a solution to create a Movable Transparent Panel in C#.

I have found several solutions to the Transparent Panel problem that suggest
overriding OnPaintBackground and then doing nothing.

While this approach works for non-movable panels, such an approach does not
work for me.

I, also, need to implement true transparency where I see underlying
controls. I do not want to create transparency to the users background image
as controls may exist between my transparent controls and the backgournd
image.

My reading and web-browsing suggests that the only way it would be possibe
to implement true transparency in .net is along the following lines

override OnPaintBackground()

// get the background image of the current control
Image oldImage = saveCurrentDisplayToImage()

// call the base method
base.OnPaintBackground(PaintEventArgs)

// use graphics to redraw background image back in to the control
PaintEventArgs.DrawImage( oldImage ....

My difficulty with this approach is that I can not find a clean way to
implement capturing the current controls image. I have found a few approaches
using the Win32 API that seem too complicated. Is there an easy way to get a
controls screen display into an image ? Or perhaps someone has succeeded in a
better way of implementing true transparency.

Thanks,

Dan

1 Answer

CiccioPalla

12/10/2004 12:32:00 AM

0

http://www.bobpowell.net/transco...

"Dan Noel" <DanNoel@discussions.microsoft.com> ha scritto nel messaggio
news:3E3E888E-10F5-4C55-ADB7-64B55CB4C05C@microsoft.com...
>
> I am looking for a solution to create a Movable Transparent Panel in C#.
>
> I have found several solutions to the Transparent Panel problem that
suggest
> overriding OnPaintBackground and then doing nothing.
>
> While this approach works for non-movable panels, such an approach does
not
> work for me.
>
> I, also, need to implement true transparency where I see underlying
> controls. I do not want to create transparency to the users background
image
> as controls may exist between my transparent controls and the backgournd
> image.
>
> My reading and web-browsing suggests that the only way it would be possibe
> to implement true transparency in .net is along the following lines
>
> override OnPaintBackground()
>
> // get the background image of the current control
> Image oldImage = saveCurrentDisplayToImage()
>
> // call the base method
> base.OnPaintBackground(PaintEventArgs)
>
> // use graphics to redraw background image back in to the control
> PaintEventArgs.DrawImage( oldImage ....
>
> My difficulty with this approach is that I can not find a clean way to
> implement capturing the current controls image. I have found a few
approaches
> using the Win32 API that seem too complicated. Is there an easy way to get
a
> controls screen display into an image ? Or perhaps someone has succeeded
in a
> better way of implementing true transparency.
>
> Thanks,
>
> Dan
>