Instance Method

bestRepresentationForRect:context:hints:

Returns the best representation of the image for the specified rectangle using the provided hints.

Declaration

- (NSImageRep *)bestRepresentationForRect:(NSRect)rect context:(NSGraphicsContext *)referenceContext hints:(NSDictionary<NSImageHintKey, id> *)hints;

Parameters

rect

The area of the image to return.

referenceContext

A graphics context. This value can be nil.

hints

An optional dictionary of hints that provide more context for selecting or generating a CGImage, and may override properties of the referenceContext. See Image Hint Dictionary Keys for a summary of the possible key-value pairs.

Return Value

The image representation that most closely matches the specified criteria.

See Also

Working with Image Representations

- addRepresentation:

Adds the specified image representation object to the image.

- addRepresentations:

Adds an array of image representation objects to the receiver.

representations

An array containing all of the receiver's image representations.

- removeRepresentation:

Removes and releases the specified image representation.

NSImageHintKey

Constants for the keys to include in a hints dictionary when drawing the image.

NSImageLayoutDirection

The layout direction for the image.