Important: The information in this document is obsolete and should not be used for new development.
OpenPoly
To begin defining a polygon, use theOpenPoly
function.
FUNCTION OpenPoly:\xDD\xDDPolyHandle;DESCRIPTION
TheOpenPoly
function returns a handle to a new polygon and starts saving lines for processing as a polygon definition. While a polygon is open, all calls to theLine
andLineTo
procedures affect the outline of the polygon. Only the line endpoints affect the polygon definition; the pattern mode, pattern, and size do not affect it. TheOpenPoly
function calls theHidePen
procedure, so no drawing occurs on the screen while the polygon is open (unless you call theShowPen
procedure just after callingOpenPoly
, or you calledShowPen
previously without balancing it by a call toHidePen
).A polygon should consist of a sequence of connected lines. The
OpenPoly
function stores the definition for a polygon in aPolygon
record.When a polygon is open, the current graphics port's
polySave
field contains a handle to information related to the polygon definition. If you want to temporarily disable the polygon definition, you can save the current value of this field, set the field toNIL
, and later restore the saved value to resume the polygon definition.Even though the onscreen presentation of a polygon is clipped, the definition of a polygon is not; you can define a polygon anywhere on the coordinate plane.
When you are finished calling the line-drawing routines that define your polygon, use the
ClosePoly
procedure, described next.SPECIAL CONSIDERATIONS
Do not callOpenPoly
while a region or another polygon is already open.Polygons are limited to 64 KB. You can determine the polygon size while it's being formed by calling the Memory Manager function
GetHandleSize
, which is described in Inside Macintosh: Memory.The
OpenPoly
function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.SEE ALSO
Listing 3-10 on page 3-26 illustrates how to use this function to create a triangle. ThePolygon
record is described on page 3-33.