Important: The information in this document is obsolete and should not be used for new development.
PenPixPat
To set the pixel pattern to be used by the graphics pen in the current color graphics port, use thePenPixPatprocedure. To assign a pixel pattern as the background pattern, you can use theBackPixPatprocedure; this allows theScrollRectprocedure and the shape-erasing procedures (for example,EraseRect) to fill the background with a colored, patterned "ink."
PROCEDURE PenPixPat (ppat: PixPatHandle);
ppat- A handle to the pixel pattern to use as the pen pattern.
DESCRIPTION
ThePenPixPatprocedure sets the graphics pen to use the pixel pattern that you specify in theppatparameter. ThePenPixPatprocedure is similar to the basic QuickDraw procedurePenPat, except that you passPenPixPata handle to a multicolored pixel pattern rather than a bit pattern.The
PenPixPatprocedure stores the handle to the pixel pattern in thepnPixPatfield of theCGrafPortrecord. Because the handle to the pixel pattern is stored in theCGrafPortrecord, you should not dispose of this handle. QuickDraw removes all references to your pattern from an existing graphics port when you dispose of it.If you use
PenPixPatto set a pixel pattern in a basic graphics port, the data in thepat1Datafield of thePixPatrecord is placed into thepnPatfield of theGrafPortrecord.SPECIAL CONSIDERATIONS
ThePenPixPatprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.SEE ALSO
ThePixPatrecord is described on page 4-49. To define your own pixel pattern, you can create a pixel pattern resource, which is described on page 4-94, or you can use theNewPixPatfunction, which is described on page 4-79.The
GrafPortrecord is described in the chapter "Basic QuickDraw." To set the graphics pen to use a bit pattern, you can also use thePenPatprocedure, which is described in the chapter "QuickDraw Drawing" in this book. ThePenPatprocedure creates a handle, of typePixPatHandle, for the bit pattern and stores this handle in thepnPixPatfield of theCGrafPortrecord.