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 theOpenPoly
function and then some number ofLineTo
procedures 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 theClosePoly
procedure, which completes the figure by drawing a connecting line from the last vertex back to the first.After you use the
OpenPoly
function to create a polygon, QuickDraw begins collecting the line-drawing information you provide into aPolygon
record. TheOpenPoly
function returns a handle to the newly allocatedPolygon
record.After defining a polygon in this way, you can draw it with the
FramePoly
,PaintPoly
, andFillPoly
procedures. You can move it by using theOffSetPoly
procedure. When you are finished using the polygon, use theKillPoly
procedure to release its memory. When using theClosePoly
,OffsetPoly
, andKillPoly
procedures, you refer to a polygon by the handle returned byOpenPoly
when you first created the polygon.
- Note
- If, while your application draws a polygon, it exceeds available stack space in Color QuickDraw, the
QDError
function (described in the chapter "Color QuickDraw" in this book) returns the result code -144.
Subtopics
- OpenPoly
- ClosePoly
- OffsetPoly
- KillPoly