Lars Nilsson

Lars Nilsson

  • NA
  • 6
  • 10.1k

C# graphics move rectangle

Aug 10 2010 7:39 AM
Hey guys,

I got kinda stuck now as Im working on something.

Im using C#'s paint event to draw the graphics, and I have a problem. If the rectangle variable Rect = a specific value, it should start there. Now if there is another position available,
it should simply move to this position in an animation done with a delay as the Thread.Sleep(); command.

What is the code for moving it say 100 pixels in X and about 50 pixels in Y?
I doesnt matter if the rectangle is redrawn on top of itself.

Thanks,

- Lars.

Answers (1)