Contents

image(_:sourceRect:scale:)

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

Declaration

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.