Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 3 - QuickDraw Drawing / QuickDraw Drawing Reference

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 and ShowPen procedures to change the pen's visibility, the PenSize procedure to change its shape, the PenPat procedure to change its pattern, and the PenMode procedure to change its pattern mode. To determine the size, location, pattern, and pattern mode of the graphics pen, you can use the GetPenState procedure. If you need to temporarily change these characteristics, you can use the SetPenState procedure to restore the graphics pen to a state previously captured by GetPenState.

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 the PenNormal 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 or CGrafPort 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.")


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996