<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIImage/draw(in:from:operation:fraction:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIImage(im)drawInRect:fromRect:operation:fraction:"
  },
  "title" : "draw(in:from:operation:fraction:)"
}
-->

# draw(in:from:operation:fraction:)

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

```
func draw(in rect: NSRect, from fromRect: NSRect, operation op: NSCompositingOperation, fraction delta: CGFloat)
```

## Parameters

`rect`

The rectangle in which to draw the image.

`fromRect`

The source rectangle specifying the portion of the image you want to draw. The coordinates of this rectangle must be specified using the image’s own coordinate system.

`op`

The compositing operation to use when drawing the image. For details, see <doc://com.apple.documentation/documentation/AppKit/NSCompositingOperation>.

`delta`

The opacity of the image, specified as a value from `0.0` to `1.0`. Specifying a value of `0.0` draws the image as fully transparent while a value of `1.0` draws the image as fully opaque. Values greater than `1.0` are interpreted as `1.0`.

## Discussion

If the `srcRect` and `dstRect` rectangles have different sizes, the source portion of the image is scaled to fit the specified destination rectangle. The image is otherwise positioned and oriented using 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)