A set of optional methods that you can use to respond to drawing failures and manage incremental loads.


protocol NSImageDelegate


Responding to Drawing Failure

func imageDidNotDraw(NSImage, in: NSRect) -> NSImage?

Tells the delegate that the image object is unable, for whatever reason, to lock focus on its image or draw in the specified rectangle.

Managing Incremental Loads

func image(NSImage, didLoadPartOfRepresentation: NSImageRep, withValidRows: Int)

Tells the delegate that part of the incrementally loaded image data is available.

func image(NSImage, didLoadRepresentation: NSImageRep, with: NSImage.LoadStatus)

Tells the delegate that an incrementally loaded image has been loaded and decompressed as completely as is possible.

func image(NSImage, didLoadRepresentationHeader: NSImageRep)

Tells the delegate that enough data has been read to determine the size of the image.

func image(NSImage, willLoadRepresentation: NSImageRep)

Tells the delegate that the image object is about to access its underlying bitmap data.

enum NSImage.LoadStatus

Status values for incremental image loading.


Inherits From

See Also


Providing Images for Different Appearances

Supply image resources that work for light and dark appearances and for high-contrast environments.

Supporting Continuity Camera in Your Mac App

Incorporate scanned documents and pictures taken with a user's iPhone, iPad, or iPod touch into your Mac app using Continuity Camera.

class NSImage

A high-level interface for manipulating image data.

class NSImageRep

A semiabstract superclass that provides subclasses that you use to draw an image from a particular type of source data.