Initializer

init(graphicsPort:flipped:)

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

Declaration

init(graphicsPort: UnsafeMutableRawPointer, flipped initialFlippedState: Bool)

Parameters

graphicsPort

The graphics port used to create the graphics-context object. Typically graphicsPort is a CGContextRef (opaque type) object.

initialFlippedState

Specifies the receiver's initial flipped state. This is the value returned by isFlipped when no view has focus.

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(window: NSWindow)

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