views:

324

answers:

1

The problem:

I have a UserControl (LightBox) which overlays a number of other controls to allow the user to see the controls it is positioned over, but not allow the users to interact with the controls under the Lightbox. Winforms is (almost notoriously as I'm finding out) bad at handling alpha-blending.

Question:

How can I get the Lighbox control to render a bmp (snapshot) of whatever it is positioned over when it is created?

Explanation:

The reason I am looking to do this is to allow the Lightbox to draw its own background from this rendered snapshot. This would (hopefully) stop the issues that I am experiencing with large quantities of flicker and undesirable rendering affects.

Is this even possible?!

Thanks for your help.

EDIT 1: This question seems to expain some of the issues that I am facing and at least describes what I am attempting to do i.e. create a buffer of the background image. However, there are no links explaining how this might ab achieved

+1  A: 

You can use the Control.DrawToBitmap function to draw the control to a Bitmap:

heavyd