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 / Changing the Background Bit Pattern


To change the bit pattern used as the background pattern by the current graphics port, use the BackPat procedure.

PROCEDURE BackPat (pat: Pattern); 
A bit pattern, as defined by a Pattern record.
The BackPat procedure sets the bit pattern defined in the Pattern record, which you specify in the pat parameter, to be the background pattern. (The standard bit patterns white, black, gray, ltGray, and dkGray are predefined; the initial background pattern for the graphics port is white.) This pattern is stored in the bkPat field of a GrafPort record.

The BackPat procedure also sets a bit pattern for the background color in a color graphics port. The BackPat procedure creates a handle, of type PixPatHandle, for the bit pattern and stores this handle in the bkPixPat field of the CGrafPort record. As in basic graphics ports, Color QuickDraw draws patterns in color graphics ports at the time of drawing, not at the time you use PenPat to set the pattern.

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

The Pattern record is described on page 3-36. To define your own patterns, you typically create pattern or pattern list resources, which are described beginning on page 3-136.

The CGrafPort record is described in the chapter "Color QuickDraw." To use a multicolored background pattern in a color graphics port, use the BackPixPat procedure, which is described in the chapter "Color QuickDraw."

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996