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 theCloseRgn
procedure.
PROCEDURE CloseRgn (dstRgn: rgnHandle);
dstRgn
- The handle to the region to close.
DESCRIPTION
TheCloseRgn
procedurestops 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 dstRgn
parameter. The
handle you
pass in thedstRgn
parameter should be a region handlereturned by
theNewRgn function.
The
CloseRgn
procedure does not create the destination region; you must have already allocated space for it by using theOpenRgn
procedure.
TheCloseRgn
procedure calls theShowPen
procedure, balancing the call to theHidePen
procedure made byOpenRgn.
When you no longer need the memory occupied by the region, use the
DisposeRgn
procedure, 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, theQDError
function (described in the chapter "Color QuickDraw" in this book) returns the result coderegionTooBigError
. Since the resulting region is potentially corrupt, theCloseRgn
procedure returns an empty region if it detectsQDError
has returnedregionTooBigError
.The
CloseRgn
procedure 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.