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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.