![]() |
PenState |
Header: Quickdraw.h |
struct PenState { Point pnLoc; Point pnSize; SInt16 pnMode; Pattern pnPat; };
For the current graphics port at the time the GetPenState function was called, the value of that graphics ports pnLoc field. This value is the point where QuickDraw begins drawing next. The location of the graphics pen is a point in the graphics ports coordinate system, not a pixel in a bit image. The upper-left corner of the pen is at the pen location; the graphics pen hangs below and to the right of this point.
For the current graphics port at the time the GetPenState function was called, the value of that graphics ports pnSize field. The graphics pen is rectangular in shape, and its width and height are specified by the values in the pnSize field. The default size is a 1-by-1 bit square; the width and height can range from 0 by 0 to 32,767 by 32,767. If either the pen width or the pen height is 0, the pen does not draw. Heights or widths of less than 0 are undefined.
The pattern modethat is, for the current graphics port at the time the GetPenState function was called, the value of that graphics ports pnMode field. This value determines how the pen pattern is to affect whats already in the bit image when lines or shapes are drawn. When the graphics pen draws, QuickDraw first determines what bits in the bit image are affected, finds their corresponding bits in the pattern, and then transfers the bits from the pattern into the image according to this mode, which specifies one of eight Boolean transfer operations. The resulting bit is stored into its proper place in the bit image.
For the current graphics port at the time the GetPenState function was called, the pen pattern for that graphics port. This pattern determines how the bits under the graphics pen are affected when lines or shapes are drawn.
The GetPenState function saves the location, size, pattern, and pattern mode of the graphics pen for the current graphics port in a PenState structure, which is a data structure of type PenState. After changing the graphics pen as necessary, you can later restore these pen states with the SetPenState function.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)