March 07, 2012

Drawing a Line

Today, let's learn to draw a line -

        Before all , remember that you have to type "SCREEN 9" in the type area of Q basic.
The syntax of the command to draw a line-
                 LINE  ( X1 , Y1 ) - ( X2 , Y2 ), C , ( B , (F))
Where,
      ( X1 , Y1 ) = the coordinate of the starting point of line
      ( X2 , Y2 ) = the coordinate of the ending point of line
       C = the color code
       B and BF = used to draw an empty or filled rectangle respectively in which ( X1 , Y1)-( X2, Y2) specify diagonally opposite corners.

   X1, X2 represent the column number
   Y1, Y2 represent the row number.

Examples-
     1.  Drawing a line-
                   CLS
                   SCREEN 9
                   LINE (10,10)-(100,100), 9
                   END
            This draws a line from the pixel pointed 10,10 to the pixel pointed 100,100 in blue.  

               Don't just draw a line and feel happy seeing it.
               Try complex figures and matrixes.

No comments:

Post a Comment