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 Rectangles


InsetRect

To shrink or expand a rectangle, use the InsetRect procedure.

PROCEDURE InsetRect (VAR r:\xDDRect; dh,dv:\xDDInteger); 
r
The rectangle to alter.
dh
The horizontal distance to move the left and right sides in toward or outward from the center of the rectangle.
dv
The vertical distance to move the top and bottom sides in toward or outward from the center of the rectangle.
DESCRIPTION
The InsetRect procedure shrinks or expands the rectangle that you specify in the r parameter: the left and right sides are moved in by the amount you specify in the dh parameter; the top and bottom are moved toward the center by the amount you specify in the dv parameter. If the value you pass in dh or dv is negative, the appropriate pair of sides is moved outward instead of inward. The effect is to alter the size by 2*dh horizontally and 2*dv vertically, with the rectangle remaining centered in the same place on the coordinate plane.

If the resulting width or height becomes less than 1, the rectangle is set to the empty rectangle (0,0,0,0).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996