---
title: "image(_:sourceRect:scale:)"
framework: swiftui
role: symbol
role_heading: Type Method
path: "swiftui/shapestyle/image(_:sourcerect:scale:)"
---

# image(_:sourceRect:scale:)

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

## Declaration

```swift
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

Discussion For information about how to use shape styles, see ShapeStyle.
