Contents

init(attributes:)

Creates a graphics context using the specified attributes.

Declaration

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

Parameters

  • attributes:

    A dictionary of values associated with the keys described in Attributekey. The attributes specify such things as representation format and destination.

Return Value

A new NSGraphicsContext object, or nil if the object could not be created.

Discussion

Use this method to create a graphics context for a window or bitmap destination. If you want to create a graphics context for a PDF or PostScript destination, do not use this method; instead, use the NSPrintOperation class to set up the printing environment needed to generate that type of information.

See Also

Creating a Graphics Context