Important: The information in this document is obsolete and should not be used for new development.
 
  
  
  
 
OpenPoly
To begin defining a polygon, use theOpenPolyfunction.
FUNCTION OpenPoly:\xDD\xDDPolyHandle;DESCRIPTION
TheOpenPolyfunction 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 theLineandLineToprocedures affect the outline of the polygon. Only the line endpoints affect the polygon definition; the pattern mode, pattern, and size do not affect it. TheOpenPolyfunction calls theHidePenprocedure, so no drawing occurs on the screen while the polygon is open (unless you call theShowPenprocedure just after callingOpenPoly, or you calledShowPenpreviously without balancing it by a call toHidePen).A polygon should consist of a sequence of connected lines. The
OpenPolyfunction stores the definition for a polygon in aPolygonrecord.When a polygon is open, the current graphics port's
polySavefield 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
ClosePolyprocedure, described next.SPECIAL CONSIDERATIONS
Do not callOpenPolywhile 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
OpenPolyfunction 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. ThePolygonrecord is described on page 3-33.
 
  
  
 