[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

Assuming that you have properly initialized your RastPort structure to
include a properly initialized AreaInfo, you can perform area fill by
using the functions described in this section.

AreaMove() tells the system to begin a new polygon, closing off any other
polygon that may already be in process by connecting the end-point of the
previous polygon to its starting point. AreaMove() is executed with the
statement:

    LONG result;
    result = AreaMove(&rastPort, x, y);

AreaMove() returns 0 if successful, -1 if there was no more space left in
the vector list. AreaDraw() tells the system to add a new vertex to a list
that it is building.  No drawing takes place until AreaEnd() is executed.
AreaDraw is executed with the statement:

    LONG result;
    result = AreaDraw(&rastPort, x, y);

AreaDraw() returns 0 if successful, -1 if there was no more space left in
the vector list. AreaEnd() tells the system to draw all of the defined
shapes and fill them.  When this function is executed, it obeys the
drawing mode and uses the line pattern and area pattern specified in your
RastPort to render the objects you have defined.

To fill an area, you do not have to AreaDraw() back to the first point
before calling AreaEnd().  AreaEnd() automatically closes the polygon.
AreaEnd() is executed with the following statement:

    LONG result;
    result = AreaEnd(&rastPort);

AreaEnd() returns 0 if successful, -1 if there was an error. To turn off
the outline function, you have to set the RastPort Flags variable back to
0 with BNDRYOFF():

    #include "graphics/gfxmacros.h"

    BNDRYOFF(&rastPort);

Otherwise, every subsequent area-fill or rectangle-fill operation will
outline their rendering with the outline pen (AOlPen).