<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ShapeStyle/image(_:sourceRect:scale:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10ShapeStylePA2A10ImagePaintVRszrlE5image_10sourceRect5scaleAeA0E0V_So6CGRectV14CoreFoundation7CGFloatVtFZ"
  },
  "title" : "image(_:sourceRect:scale:)"
}
-->

# image(_:sourceRect:scale:)

A shape style that fills a shape by repeating a region of an image.

```
@export(implementation) static func image(_ image: Image, sourceRect: CGRect = CGRect(x: 0, y: 0, width: 1, height: 1), scale: CGFloat = 1) -> ImagePaint
```

## Parameters

`image`

The image to be drawn.

`sourceRect`

A unit-space rectangle defining how much of the source
image to draw. The results are undefined if `sourceRect` selects
areas outside the `[0, 1]` range in either axis.

`scale`

A scale factor applied to the image during rendering.

## Discussion

For information about how to use shape styles, see [`ShapeStyle`](/documentation/SwiftUI/ShapeStyle).

---

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)