[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

Two functions are associated with line drawing: move() and draw(). move()
simply moves the cursor to a new position.  It is like picking up a
drawing pen and placing it at a new location. This function is executed by
the statement:

    Move(&rastPort, x, y);

draw() draws a line from the current x,y position to a new x,y position
specified in the statement itself. The drawing pen is left at the new
position. This is done by the statement:

    Draw(&rastPort, x, y);

draw() uses the pen color specified for fgpen. here is a sample sequence
that draws a line from location (0,0) to (100,50).

    SetAPen(&rastPort, COLOR1);    /* Set A pen color. */
    Move(&rastPort, 0, 0);    /* Move to this location. */
    Draw(&rastPort, 100,50);    /* Draw to a this location. */


    Caution:
    --------
    If you attempt to draw a line outside the bounds of the bitmap,
    using the basic initialized rastport, you may crash the system.
    You must either do your own software clipping to assure that the line
    is in range, or use the layers library. Software clipping means that
    you need to determine if the line will fall outside your BitMap
    before you draw it, and render only the part which falls inside
    the BitMap.