Initializer

init(window:)

Creates and returns a new graphics context for drawing into a window.

Declaration

init(window: NSWindow)

Parameters

aWindow

The window object representing the window to use for drawing.

Return Value

The created NSGraphicsContext object or nil if the object could not be created.

See Also

Creating a Graphics Context

init?(attributes: [NSGraphicsContext.AttributeKey : Any])

Instantiates and returns an instance of NSGraphicsContext using the specified attributes.

init?(bitmapImageRep: NSBitmapImageRep)

Instantiates and returns a new graphics context using the supplied NSBitmapImageRep object as the context destination.

init(cgContext: CGContext, flipped: Bool)

Creates a new graphics context from the specified Core Graphics context and the initial flipped state.

init(graphicsPort: UnsafeMutableRawPointer, flipped: Bool)

Instantiates and returns a new graphics context from the given graphics port.

Deprecated