Using NSGraphicsContext

The NSGraphicsContext class provides extra control over drawing. It is the main entity through which drawing commands flow, so it has a global control over all drawing sent to it. Seasoned Macintosh developers will find it useful to consider a graphics context to be analogous to a graphics port. Although there might be many graphics contexts in a given program, more often than not the current graphics context is the one of interest. The current context is the one that is being drawn right now, and generally represents the drawing surface of an NSWindow. All NSView instances in a given window will use that window’s graphics context for their actual drawing unless previously instructed to create their own private context. ...

Get Cocoa® Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.