Results 1 to 2 of 2

Thread: delay in drawing

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    21

    delay in drawing

    Hello all
    I have a question and hope u help me
    i want to draw simple line using c#
    but i want the drawing as animation
    for example in c language i used delay()
    to present the drawing as animated

    Graphics g = this.CreateGraphics() ;
    Pen pn = new Pen( Color.Blue );
    int k=0,j=0;
    for (int i =0 ;i<50;i++)
    {
    Point pt1 = new Point( k, j);
    Point pt2 = new Point( k+10, j+10);
    g.DrawLine( pn, pt1, pt2 );
    k+=5;
    j+=5;
    }
    i want delay between each loop becuase i need it as animated
    help me if u can plz

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: delay in drawing

    Add this at the last line inside the loop (not perfect but it works)

    System.Threading.Thread.Sleep(50);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width