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 2 - Basic QuickDraw / Basic QuickDraw Reference
Data Structures /


Region

You can use a region, which is a data structure of type Region, to define an arbitrary area or set of areas on the QuickDraw coordinate plane. For example, when scrolling through a window, your application must initialize an update region and pass its handle to the ScrollRect procedure (which is described on page 2-40).

The data structure for a region consists of two fixed-length fields followed by a variable-length field.

TYPE RgnHandle =  ^RgnPtr;
RgnPtr =          ^Region;
Region = 
RECORD
   rgnSize:\xDD\xDDInteger;   {size in bytes}
   rgnBBox:\xDD\xDDRect;      {enclosing rectangle}
   {more data if region is not rectangular}
END;
Field Description
rgnSize
The region's size in bytes.
rgnBBox
The rectangle that bounds the region.
The maximum size of a region is 32 KB when using basic QuickDraw, 64 KB when using Color QuickDraw. The simplest region is a rectangle. In this case, the rgnBBox field defines the entire region, and there's no optional region data. For rectangular regions (or empty regions), the rgnSize field contains 10.

Region data is stored in a proprietary format.

See the chapter "QuickDraw Drawing" for descriptions of the QuickDraw routines you can use for calculating and manipulating regions for drawing purposes.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996