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


SetRectRgn

To change the structure of an existing region to that of a rectangle, you can use the SetRectRgn procedure.

PROCEDURE SetRectRgn (rgn:\xDDRgnHandle; 
                      left,top,right,bottom: Integer);
rgn
A handle to the region to restructure as a rectangle.
left
The horizontal coordinate of the upper-left corner of the rectangle to set as the new region.
top
The vertical coordinate of the upper-left corner of the rectangle to set as the new region.
right
The horizontal coordinate of the lower-right corner of the rectangle to set as the new region.
bottom
The vertical coordinate of the lower-right corner of the rectangle to set as the new region.
DESCRIPTION
The SetRectRgn procedure destroys the previous structure of the region whose handle you pass in the rgn parameter, and it then sets the new structure to the rectangle that you specify in the left, top, right, and bottom parameters. If you specify an empty rectangle (that is, right<=left or bottom<=top), the SetRectRgn procedure sets the region to the empty region defined by the rectangle (0,0,0,0).

As an alternative to the SetRectRgn procedure, you can change the structure of an existing region to that of a rectangle by using the RectRgn procedure, which accepts as a parameter a rectangle instead of four coordinates. The RectRgn procedure is described next.

SPECIAL CONSIDERATIONS
The SetRectRgn 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