One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

ImagePaint

struct · iOS 13.0+ · SDK 27.1

@frozen struct ImagePaint

A shape style that fills a shape by repeating a region of an image. You can also use ``ShapeStyle/image(_:sourceRect:scale:)`` to construct this style.

Members (7)

get · iOS 13.0+

sourceRect

TypeScript
get sourceRect(): { x: number; y: number; width: number; height: number }
Swift declaration
var sourceRect: CGRect

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

set · iOS 13.0+

sourceRect

TypeScript
set sourceRect(value: { x: number; y: number; width: number; height: number })
Swift declaration
var sourceRect: CGRect

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

init · iOS 13.0+

init

TypeScript
static init(image: Image, sourceRect?: { x: number; y: number; width: number; height: number }, scale?: number): ImagePaint
Swift declaration
init(image: Image, sourceRect: CGRect = CGRect(x: 0, y: 0, width: 1, height: 1), scale: CGFloat = 1)

Creates a shape-filling shape style. - 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.

get · iOS 13.0+

image

TypeScript
get image(): Image
Swift declaration
var image: Image

The image to be drawn.

set · iOS 13.0+

image

TypeScript
set image(value: Image)
Swift declaration
var image: Image

The image to be drawn.

get · iOS 13.0+

scale

TypeScript
get scale(): number
Swift declaration
var scale: CGFloat

A scale factor applied to the image while being drawn.

set · iOS 13.0+

scale

TypeScript
set scale(value: number)
Swift declaration
var scale: CGFloat

A scale factor applied to the image while being drawn.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →