NSGraphicsContext

NSGraphicsContext Mac OS X 10.0

This class is an interface to graphics context objects, which interpret drawing commands based on a number of attributes that make up an environment for rendering. NSGraphicsContext can be used change a number of rendering options, such as whether or not antialiasing should be done, or whether image smoothing and interpolation should be used when drawing images.

figs/cocn_1538.gif

@interface NSGraphicsContext : NSObject
 // Accessor Methods
   - (void)setImageInterpolation:(NSImageInterpolation)interpolation;
   - (NSImageInterpolation)imageInterpolation;
   - (void)setShouldAntialias:(BOOL)antialias;
   - (BOOL)shouldAntialias;
   - (void)setFocusStack:(void *)stack;
   - (void *)focusStack;
   - (void)setPatternPhase:(NSPoint)phase;
   - (NSPoint)patternPhase;
 // Class Methods
   + (NSGraphicsContext *)currentContext;
   + (BOOL)currentContextDrawingToScreen;
   + (NSGraphicsContext *)graphicsContextWithAttributes:(NSDictionary *)attributes;
   + (NSGraphicsContext *)graphicsContextWithWindow:(NSWindow *)window;
   + (void)restoreGraphicsState;
   + (void)saveGraphicsState;
   + (void)setCurrentContext:(NSGraphicsContext *)context;
   + (void)setGraphicsState:(int)gState;
 // Instance Methods
   - (NSDictionary *)attributes;
   - (void)flushGraphics;
   - (void *)graphicsPort;
   - (BOOL)isDrawingToScreen;
   - (void)restoreGraphicsState;
   - (void)saveGraphicsState;



    Part II: API Quick Reference
    Chapter 13. Foundation Classes