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


OffsetRgn

To move a region, use the OffsetRgn procedure.

PROCEDURE OffsetRgn (rgn:\xDDRgnHandle; dh,dv:\xDDInteger);
rgn
A handle to the region to move.
dh
The horizontal distance to move the region.
dv
The vertical distance to move the region.
DESCRIPTION
The OffsetRgn procedure moves the region whose handle you pass in the rgn parameter by adding the value you specify in the dh parameter to the horizontal coordinates of all points of its region boundary, and by adding the value you specify in the dv parameter to the vertical coordinates of all points of its region boundary. If the values of dh and dv are positive, the movement is to the right and down; if either is negative, the corresponding movement is in the opposite direction. The region retains its size and shape. This doesn't affect the screen unless you subsequently call a routine to draw the region.

The OffsetRgn procedure is an especially efficient operation, because most of the data defining a region is stored relative to the rgnBBox field in its Region record and so isn't actually changed by OffsetRgn.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996