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