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


DiffRgn

To subtract one region from another, use the DiffRgn procedure.

PROCEDURE DiffRgn (srcRgnA,srcRgnB,dstRgn:\xDDRgnHandle);
srcRgnA
A handle to the region to subtract from.
srcRgnB
A handle to the region to subtract.
dstRgn
A handle to the region to hold the resulting area.
DESCRIPTION
The DiffRgn procedure subtracts the region whose handle you pass in the srcRgnB parameter from the region whose handle you pass in the srcRgnA parameter and places the difference in the region whose handle you pass in the dstRgn parameter. If the first source region is empty, DiffRgn sets the destination to the empty region defined by the rectangle (0,0,0,0).

The DiffRgn procedure does not create the destination region; you must have already allocated memory for it by using the NewRgn function. The destination region may be one of the source regions, if desired.

SPECIAL CONSIDERATIONS
The DiffRgn procedure may temporarily use heap space that's twice the size of the two input regions.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996