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 / Scaling and Mapping Points, Rectangles, Polygons, and Regions


MapRgn

To map and scale a region within one rectangle to another rectangle, use the MapRgn procedure.

PROCEDURE MapRgn (rgn:\xDDRgnHandle; srcRect,dstRect:\xDDRect);
rgn
A handle to a region. Upon input, this is the region to map. Upon completion, this region is the one mapped to a new location.
srcRect
The rectangle containing the region to map.
dstRect
The rectangle in which the new region will be mapped.
DESCRIPTION
The MapRgn procedure takes a region within one rectangle and maps and scales it to another rectangle. In the rgn parameter, you specify a handle to a region that lies within the rectangle that you specify in the srcRect parameter. By calling the MapPt procedure to map all the points of the region in the rgn parameter, MapRgn maps and scales it to the rectangle that you specify in the dstRect parameter. The MapRgn procedure returns the result in the region whose handle you initially passed in the rgn parameter.

The MapRgn procedure is useful for determining whether a region operation will exceed available memory.\xDD\xDDBy mapping a large region into a smaller one and performing the operation (without actually drawing), you can estimate how much memory will be required by the anticipated operation.

SPECIAL CONSIDERATIONS
The MapRgn procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996