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 / Managing the Graphics Pen


To set the bit pattern to be used by the graphics pen in the current graphics port, use the PenPat procedure.

PROCEDURE PenPat (pat: Pattern); 
A bit pattern, as defined by a Pattern record.
The PenPat procedure sets the graphics pen to use the bit pattern defined in the Pattern record that you specify in the pat parameter. (The standard patterns white, black, gray, ltGray, and dkGray are predefined; the initial bit pattern for the pen is black.) This pattern is stored in the pnPat field of a GrafPort record. The QuickDraw painting procedures (such as PaintRect) also use the pen's pattern when drawing a shape.

The PenPat procedure also sets a bit pattern for the graphics pen in a color graphics port. The PenPat procedure creates a handle, of type PixPatHandle, for the bit pattern and stores this handle in the pnPixPat field of the CGrafPort record. This pattern always uses the graphics port's current foreground and background colors.

The PenPat 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 set the graphics pen to use a multicolored pixel pattern in a color graphics port, use the PenPixPat procedure, which is described in the chapter "Color QuickDraw."

Listing 3-3 on page 3-18 illustrates how to use the PenPat procedure.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996