Important: The information in this document is obsolete and should not be used for new development.
OffsetRgn
To move a region, use theOffsetRgnprocedure.
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
TheOffsetRgnprocedure moves the region whose handle you pass in thergnparameter by adding the value you specify in thedhparameter to the horizontal coordinates of all points of its region boundary, and by adding the value you specify in thedvparameter to the vertical coordinates of all points of its region boundary. If the values ofdhanddvare 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
OffsetRgnprocedure is an especially efficient operation, because most of the data defining a region is stored relative to thergnBBoxfield in itsRegionrecord and so isn't actually changed byOffsetRgn.