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 / Drawing Rectangles


To erase a rectangle, use the EraseRect procedure.

PROCEDURE EraseRect (r:\xDDRect);
The rectangle to erase.
Using the patCopy pattern mode, the EraseRect procedure draws the interior of the rectangle that you specify in the r parameter with the background pattern for the current graphics port. This effectively erases the rectangle specified in the r parameter. For example, you can use EraseRect to erase the port rectangle for a window before redrawing into the window.

This procedure leaves the location of the graphics pen unchanged.

The EraseRect procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.

Listing 6-2 on page 6-10 in the chapter "Offscreen Graphics Worlds" in this book illustrates how to use EraseRect to initialize an offscreen pixel map. The patCopy pattern mode is described in "Boolean Transfer Modes With 1-Bit Pixels" beginning on page 3-7.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996