Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 3 - QuickDraw Drawing / QuickDraw Drawing Reference
Routines / Creating and Managing Regions


To begin creating a new region, use the NewRgn function.

FUNCTION NewRgn: RgnHandle;
The NewRgn function allocates space for a new, variable-size region; initializes it to the empty region defined by the rectangle (0,0,0,0); and returns a handle to the new region. This is the only function that creates a new region; other routines merely alter the size or shape of existing regions.

To begin defining a region, use the OpenRgn procedure, described next.

The NewRgn function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.

Use the Memory Manager function MaxMem (described in Inside Macintosh: Memory) to determine whether the memory for the region is valid before using NewRgn.

Listing 3-8 on page 3-24 and Listing 3-9 on page 3-25 illustrate how to use this function.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996