Important: The information in this document is obsolete and should not be used for new development.
Creating and Managing Polygons
A polygon is defined by a sequence of connected lines. To create a polygon, you first call theOpenPolyfunction and then some number ofLineToprocedures 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 theClosePolyprocedure, 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 aPolygonrecord. TheOpenPolyfunction returns a handle to the newly allocatedPolygonrecord.After defining a polygon in this way, you can draw it with the
FramePoly,PaintPoly, andFillPolyprocedures. You can move it by using theOffSetPolyprocedure. When you are finished using the polygon, use theKillPolyprocedure to release its memory. When using theClosePoly,OffsetPoly, andKillPolyprocedures, you refer to a polygon by the handle returned byOpenPolywhen you first created the polygon.
- Note
- 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.![]()
Subtopics
- OpenPoly
- ClosePoly
- OffsetPoly
- KillPoly