graphics

Asked By John Watts
03-Nov-09 06:15 PM
Earn up to 0 extra points for answering this tough question.

I am writing a graphics program where I have to make a circle go across a rectangle stop at the end of the rectangle and then turn and go back.  How do I get it to go back?

 

Thank you

  re

Web Star replied to John Watts
03-Nov-09 10:45 PM

DrawEllipse method is used to draw ellipse or circle.

protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics ;
Pen pen = new Pen( Color.Black,3 );
Rectangle rect = new Rectangle(4, 4, 100, 100);
g.DrawEllipse( pen, rect );
}

u can draw rectangle as follows

C# code to draw a Rectangle

http://www.eggheadcafe.com/tutorials/aspnet/387702a9-0a40-43a4-9e82-6f6d8eb86205/c-graphics--a-gdi-worl.aspx

http://www.homeandlearn.co.uk/csharp/csharp_s15p2.html

Create New Account