O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSGraphicsContext — Mac OS X 10.0

Synopsis

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.

image with no caption

@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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required