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
HidePen
andShowPen
procedures to change the pen's visibility, thePenSize
procedure to change its shape, thePenPat
procedure to change its pattern, and thePenMode
procedure to change its pattern mode. To determine the size, location, pattern, and pattern mode of the graphics pen, you can use theGetPenState
procedure. If you need to temporarily change these characteristics, you can use theSetPenState
procedure 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
patCopy
pattern mode. After changing any of these values, you can use thePenNormal
procedure 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
GrafPort
orCGrafPort
record. 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