Important: The information in this document is obsolete and should not be used for new development.
PenPat
To set the bit pattern to be used by the graphics pen in the current graphics port, use thePenPatprocedure.
PROCEDURE PenPat (pat: Pattern);
pat- A bit pattern, as defined by a
Patternrecord.DESCRIPTION
ThePenPatprocedure sets the graphics pen to use the bit pattern defined in thePatternrecord that you specify in thepatparameter. (The standard patternswhite,black,gray,ltGray, anddkGrayare predefined; the initial bit pattern for the pen isblack.) This pattern is stored in thepnPatfield of aGrafPortrecord. The QuickDraw painting procedures (such asPaintRect) also use the pen's pattern when drawing a shape.The
PenPatprocedure also sets a bit pattern for the graphics pen in a color graphics port. ThePenPatprocedure creates a handle, of typePixPatHandle, for the bit pattern and stores this handle in thepnPixPatfield of theCGrafPortrecord. This pattern always uses the graphics port's current foreground and background colors.SPECIAL CONSIDERATIONS
ThePenPatprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.SEE ALSO
ThePatternrecord 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
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 thePenPixPatprocedure, which is described in the chapter "Color QuickDraw."Listing 3-3 on page 3-18 illustrates how to use the
PenPatprocedure.