Important: The information in this document is obsolete and should not be used for new development.
CloseRgn
To organize a collection of lines and shapes into a region definition, use theCloseRgnprocedure.
PROCEDURE CloseRgn (dstRgn: rgnHandle);
dstRgn- The handle to the region to close.
DESCRIPTION
TheCloseRgnprocedurestops the collection of lines and framed shapes, organizes them into a region definition, and saves the result in the region whose handle you pass in the dstRgnparameter. Thehandle youpass in thedstRgnparameter should be a region handlereturned bytheNewRgn function.The
CloseRgnprocedure does not create the destination region; you must have already allocated space for it by using theOpenRgnprocedure.TheCloseRgnprocedure calls theShowPenprocedure, balancing the call to theHidePenprocedure made byOpenRgn.When you no longer need the memory occupied by the region, use the
DisposeRgnprocedure, described next.SPECIAL CONSIDERATIONS
Regions are limited to 32 KB in size in basic QuickDraw and 64 KB in Color QuickDraw. When you record drawing operations in an open region, the resulting region description may overflow this limit. Should this happen in Color QuickDraw, theQDErrorfunction (described in the chapter "Color QuickDraw" in this book) returns the result coderegionTooBigError. Since the resulting region is potentially corrupt, theCloseRgnprocedure returns an empty region if it detectsQDErrorhas returnedregionTooBigError.The
CloseRgnprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.SEE ALSO
Listing 3-8 on page 3-24 illustrates how to use this procedure.