Important: The information in this document is obsolete and should not be used for new development.
PenPatTo set the bit pattern to be used by the graphics pen in the current graphics port, use the
PROCEDURE PenPat (pat: Pattern);
- A bit pattern, as defined by a
PenPatprocedure sets the graphics pen to use the bit pattern defined in the
Patternrecord that you specify in the
patparameter. (The standard patterns
dkGrayare predefined; the initial bit pattern for the pen is
black.) This pattern is stored in the
pnPatfield of a
GrafPortrecord. The QuickDraw painting procedures (such as
PaintRect) also use the pen's pattern when drawing a shape.
PenPatprocedure also sets a bit pattern for the graphics pen in a color graphics port. The
PenPatprocedure creates a handle, of type
PixPatHandle, for the bit pattern and stores this handle in the
pnPixPatfield of the
CGrafPortrecord. This pattern always uses the graphics port's current foreground and background colors.
PenPatprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.
Patternrecord 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.
CGrafPortrecord 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
PenPixPatprocedure, which is described in the chapter "Color QuickDraw."
Listing 3-3 on page 3-18 illustrates how to use the