Important: The information in this document is obsolete and should not be used for new development.
Managing the Graphics Pen
Every graphics port contains one, and only one, graphics pen with which to perform drawing operations. You use this metaphorical pen to draw lines, shapes, and text.You can use the
HidePenandShowPenprocedures to change the pen's visibility, thePenSizeprocedure to change its shape, thePenPatprocedure to change its pattern, and thePenModeprocedure to change its pattern mode. To determine the size, location, pattern, and pattern mode of the graphics pen, you can use theGetPenStateprocedure. If you need to temporarily change these characteristics, you can use theSetPenStateprocedure to restore the graphics pen to a state previously captured byGetPenState.Upon the creation of a graphics port, QuickDraw assigns these initial values to the graphics pen: a size of (1,1), a pattern of all-black pixels, and the
patCopypattern mode. After changing any of these values, you can use thePenNormalprocedure to return these initial values to the graphics pen.These pen-manipulation routines use the local coordinate system of the current graphics port. Remember that each graphics port has its own pen, the state of which is stored in several fields of its
GrafPortorCGrafPortrecord. If you draw in one graphics port, change to another, and return to the first, the pen for the first graphics port has the same state as when you left it. (The basic graphics port is described in the chapter "Basic QuickDraw," and the color graphics port is described in the chapter "Color QuickDraw.")
Subtopics
- HidePen
- ShowPen
- GetPen
- GetPenState
- SetPenState
- PenSize
- PenMode
- PenPat
- PenNormal