views:

19

answers:

1

Question:

How do I scrape what a transparent panel shows into a bitmap?

Background:

I need to make a form that sits on top of everything and blurs part of the screen but doesn't stop the user from interacting with it. Odd... I know.

I created a form and added a panel to it. I then set the set background color of the panel to red. Then set the form's TransparentKey property to red and topmost = True.

So now I have a transparent panel. Cool. I can interact with the app below it. Cool. Now I just need to add the blur. I would like to take what is showing on panel1 and blur it then display on panel2 that sits over the top of panel1. Or at least that is the idea.

Important detail:

DrawToBitmap() just shows the red background.

This is running on XP.

+1  A: 

Yes, DrawToBitmap(). But not on the transparent panel, on the one that's underneath it. If that 'panel' isn't actually yours then you have to use Graphics.CopyFromScreen().

Not sure what you intend to do with it, but drawing the blurred image in the transparent panel will make it non-transparent and you cannot interact with the underlying window anymore. Also, don't use Red, you'll get unintended transparency if the underlying window contains any red. Color.Fuchsia is a good choice, it is a fuchsed-up color.

Hans Passant
+1 for the fuchsed-up color comment.
NitroxDM
So it sounds like I'm hosed with this approach. Interacting with the application below is a must.
NitroxDM