471,348 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Drawing on top of everything

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?
Feb 24 '06 #1
1 6827
As usual, a few minutes after posting a help-me thread, I find exactly what
I was looking for, despite hours of looking before posting :) This describes
exactly what I was after:

http://www.codeproject.com/csharp/OSDwindow.asp

If anyone has another suggestion, I'm all ears.

/Bartek

"Bartek Tatkowski" <ba**************@nospam.com> skrev i meddelandet
news:OV**************@TK2MSFTNGP10.phx.gbl...
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?

Feb 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Remon Huijts | last post: by
1 post views Thread by Leif K-Brooks | last post: by
reply views Thread by Tomi Holger Engdahl | last post: by
1 post views Thread by Sam | last post: by
5 posts views Thread by benoit | last post: by
11 posts views Thread by cty0000 | last post: by
4 posts views Thread by =?Utf-8?B?R2lkaQ==?= | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.