Instance Method

compositeToPoint:fromRect:operation:

Composites a portion of the image to the specified point in the current coordinate system.

Declaration

- (void)compositeToPoint:(NSPoint)point fromRect:(NSRect)rect operation:(NSCompositingOperation)op;

Parameters

aPoint

The point at which to draw the image, specified in the current coordinate system.

srcRect

The portion of the image you want to draw, specified in the image's coordinate system.

op

The compositing operation to use when drawing the image to the screen. The supported compositing operations are described in Constants.

Discussion

This method draws the specified portion of the image without checking the bounds rectangle you pass into the srcRect parameter. If you specify a source rectangle that strays outside of the image's bounds rectangle, it is conceivable that you could composite parts of the offscreen cache window that do not belong to the receiver's image. You can avoid this problem using the drawAtPoint:fromRect:operation:fraction: method, which checks the source rectangle before drawing.

During drawing, the image is composited from its offscreen window cache. Because the offscreen cache is not created until the image representation is first used, this method may need to render the image before compositing. Bitmap representations in particular are not cached until they are explicitly rendered. You can use the lockFocus and unlockFocus methods to force the cached version to be created.

Compositing part of an image is as efficient as compositing the whole image, but printing just part of an image is not. When printing, it’s necessary to draw the whole image and rely on a clipping path to be sure that only the desired portion appears.

During printing, this method ignores the op parameter. Even though this parameter is ignored, this method attempts to render the image as close as possible to its appearance when the compositing operation is used on the screen. In either case, the best image representation is chosen for the printing context.

See Also

Deprecated Symbols

+ imageFileTypes

Returns an array of strings identifying the image types supported by the registered image representation objects.

Deprecated
+ imageUnfilteredFileTypes

Returns an array of strings identifying the file types supported directly by the registered image representation objects.

Deprecated
+ imagePasteboardTypes

Returns an array of strings identifying the pasteboard types supported directly by the registered image representation objects.

Deprecated
+ imageUnfilteredPasteboardTypes

Returns an array of strings identifying the pasteboard types supported directly by the registered image representation objects.

Deprecated
- lockFocusOnRepresentation:

Prepares the specified image representation to receive drawing commands.

Deprecated
- bestRepresentationForDevice:

Returns the best representation for the device with the specified characteristics.

Deprecated
- compositeToPoint:operation:

Composites the entire image to the specified point in the current coordinate system.

Deprecated
- compositeToPoint:fromRect:operation:fraction:

Composites a portion of the image at the specified opacity to the current coordinate system.

Deprecated
- compositeToPoint:operation:fraction:

Composites the entire image at the specified opacity in the current coordinate system.

Deprecated
- dissolveToPoint:fraction:

Composites the entire image to the specified location using the source-over operator.

Deprecated
- dissolveToPoint:fromRect:fraction:

Composites a portion of the image to the specified location using the source-over operator.

Deprecated
- setScalesWhenResized:

Sets whether to scale different-sized image representations to fit the image's size.

Deprecated
- scalesWhenResized

Returns a Boolean value indicating whether to scale image representations to fit the image's size.

Deprecated
- setDataRetained:

Sets whether the receiver retains its source image data.

Deprecated
- isDataRetained

Returns a Boolean value indicating whether the receiver retains its source image data.

Deprecated
- setCachedSeparately:

Sets whether each image representation uses a separate offscreen window to cache its contents.

Deprecated
- isCachedSeparately

Returns a Boolean value indicating whether each image representation caches its contents in a separate offscreen window.

Deprecated
- setCacheDepthMatchesImageDepth:

Sets whether the receiver's offscreen window caches use the same bit depth as the image data itself.

Deprecated
- cacheDepthMatchesImageDepth

Returns a Boolean value indicating whether an image's offscreen window caches use the same bit depth as the image data itself.

Deprecated
- setFlipped:

Sets whether the polarity of the y axis is inverted when drawing an image.

Deprecated
- isFlipped

Returns a Boolean value indicating whether the image uses a flipped coordinate system.

Deprecated