Drawing on top of everything

B

Bartek Tatkowski

I currently developing an application (in C#) where I have to be able to
highlight different regions on the screen, by drawing a half-transparent
ellipse over it. Right now, the code I'm using is this:


// Get the Graphics object of the entire screen.
IntPtr dc1 = Utils.CreateDC("DISPLAY", null, null, (IntPtr)null);
Graphics g1 = Graphics.FromHdc(dc1);
// Draw filled ellipse
SolidBrush brush = new SolidBrush(Color.FromArgb(128, 0, 255, 0));
g1.FillEllipse(brush, x, y, w, h);
g1.Flush();

The problem with this is that I have no means of erasing what I have drawn.
Is there any way to draw on another "layer", so that the different windows I
draw on don't get draw on?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top