Invalidate a section of a graphics object

  • Thread starter Thread starter Logan
  • Start date Start date
L

Logan

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"
 
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
 
Back
Top