Structure

NSWorkspace.DesktopImageOptionKey

The following keys may be specified or returned in the options dictionary for setDesktopImageURL(_:for:options:).

Declaration

struct DesktopImageOptionKey

Topics

Type Properties

static let imageScaling: NSWorkspace.DesktopImageOptionKey

The value is an NSNumber containing an NSImageScaling constant as declared in NSCell. If this is not specified, NSImageScaling.scaleProportionallyUpOrDown is used. NSImageScaling.scaleProportionallyDown is not currently supported.

static let allowClipping: NSWorkspace.DesktopImageOptionKey

The value is an NSNumber containing a BOOL, which affects the interpretation of Proportional scaling types. A false value will make the image fully visible, but there may be empty space on the sides or top and bottom. A true value will cause the image to fill the entire screen, but the image may be clipped. If this is not specified, false is assumed. Non-proportional scaling types ignore this value.

static let fillColor: NSWorkspace.DesktopImageOptionKey

The value is an NSColor, which is used to fill any empty space around the image. If not specified, a default value is used. Currently, only colors that use or can be converted to use calibratedRGB are supported, and any alpha value is ignored.

Relationships

See Also

Managing the Desktop Image

func desktopImageURL(for: NSScreen) -> URL?

Returns the URL for the desktop image for the given screen.

func setDesktopImageURL(URL, for: NSScreen, options: [NSWorkspace.DesktopImageOptionKey : Any])

Sets the desktop image for the given screen to the image at the specified URL.