<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.6.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSImage/compositeToPoint:fromRect:operation:fraction:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSImage(im)compositeToPoint:fromRect:operation:fraction:"
  },
  "title" : "compositeToPoint:fromRect:operation:fraction:"
}
-->

# compositeToPoint:fromRect:operation:fraction:

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

```
- (void) compositeToPoint:(NSPoint) point fromRect:(NSRect) rect operation:(NSCompositingOperation) operation fraction:(CGFloat) fraction;
```

## Parameters

`point`

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

`rect`

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

`operation`

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

`fraction`

The desired opacity of the image, specified as a value between 0.0 and 1.0, with 1.0 representing total opacity. Values larger than 1.0 are interpreted as 1.0. This method always expects to render something, so for values that are equal to or less than 0, this method renders at full opacity.

## Discussion

Behaves the same as [`compositeToPoint:fromRect:operation:`](/documentation/AppKit/NSImage/compositeToPoint:fromRect:operation:) except that you can specify the amount of opacity to use when drawing the image.

## See Also

[`- (void) dissolveToPoint:(NSPoint) point fromRect:(NSRect) rect fraction:(CGFloat) fraction;`](/documentation/AppKit/NSImage/dissolveToPoint:fromRect:fraction:)

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

[`func draw(at: NSPoint, from: NSRect, operation: NSCompositingOperation, fraction: CGFloat)`](/documentation/AppKit/NSImage/draw(at:from:operation:fraction:))

Draws all or part of the image at the specified point in the current coordinate system.

[`func draw(in: NSRect, from: NSRect, operation: NSCompositingOperation, fraction: CGFloat)`](/documentation/AppKit/NSImage/draw(in:from:operation:fraction:))

Draws all or part of the image in the specified rectangle in the current coordinate system.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)