NSImage

public extension NSImage
  • Return a part of the image

    Declaration

    Swift

    func from(rect: NSRect) -> NSImage?

    Parameters

    rect

    rect to return

    Return Value

    partial image

  • Undocumented

    Declaration

    Swift

    func pngRepresentation(size requiredSize: NSSize? = nil) -> Data?
  • Undocumented

    Declaration

    Swift

    func jpegRepresentation(compression: Float = 1.0, size requiredSize: NSSize? = nil) -> Data?
  • Scales image. Aspect ratio is maintained if exactly one of width or height are non-nil

    Declaration

    Swift

    func scaledTo(width: CGFloat?, height: CGFloat?) -> NSImage?

    Parameters

    width

    new width

    height

    new height

    Return Value

    scaled image

  • Undocumented

    Declaration

    Swift

    func singlePixelImage(with size: NSSize) -> NSImage?
  • Undocumented

    Declaration

    Swift

    var cgImage: CGImage? { get }
  • Undocumented

    Declaration

    Swift

    func imageRotatedByDegreess(degrees: CGFloat) -> NSImage