Important: The information in this document is obsolete and should not be used for new development.
Creating and Managing PolygonsA polygon is defined by a sequence of connected lines. To create a polygon, you first call the
OpenPolyfunction and then some number of
LineToprocedures to draw lines from the first vertex of the polygon to the second, from the second to the third, and so on, until you've drawn a line to the last vertex. You then use the
ClosePolyprocedure, which completes the figure by drawing a connecting line from the last vertex back to the first.
After you use the
OpenPolyfunction to create a polygon, QuickDraw begins collecting the line-drawing information you provide into a
OpenPolyfunction returns a handle to the newly allocated
After defining a polygon in this way, you can draw it with the
FillPolyprocedures. You can move it by using the
OffSetPolyprocedure. When you are finished using the polygon, use the
KillPolyprocedure to release its memory. When using the
KillPolyprocedures, you refer to a polygon by the handle returned by
OpenPolywhen you first created the polygon.
- If, while your application draws a polygon, it exceeds available stack space in Color QuickDraw, the
QDErrorfunction (described in the chapter "Color QuickDraw" in this book) returns the result code -144.