By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,656 Members | 1,327 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,656 IT Pros & Developers. It's quick & easy.

Invalidate a section of a graphics object

P: n/a
I am writting an application in C# that draws a square under your mouse
whenever you move it. I created a graphics object of the "desktop" and i
can draw on it without problem but i can't figure out how to erase the old
boxes when the mouse is moved. I imagine there must be a way to invalidate
a rectangle of a graphics object but i haven't found a way.

Thanks in advance,
~Logan

Here is the code i use to get the graphics object for the "desktop"
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

One way to do this is to set a clipping region on the Graphics object. One
method of setting a clipping region requires that you use a Region object.
Take a look at this object and the Graphics.Clip property.

Robby

"Logan" <lo***@globalweb.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am writting an application in C# that draws a square under your mouse
whenever you move it. I created a graphics object of the "desktop" and i
can draw on it without problem but i can't figure out how to erase the old
boxes when the mouse is moved. I imagine there must be a way to invalidate
a rectangle of a graphics object but i haven't found a way.

Thanks in advance,
~Logan

Here is the code i use to get the graphics object for the "desktop"

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.