Contents

draw(_:at:anchor:)

Draws an image into the context, aligning an anchor within the image to a point in the context.

Declaration

func draw(_ image: Image, at point: CGPoint, anchor: UnitPoint = .center)

Parameters

  • image:

    The Image to draw. Before drawing, the method converts the image to a Resolvedimage by calling Resolve(_:) 898z6.

  • point:

    A point within the rectangle of the resolved image to anchor to a point in the context.

  • anchor:

    A Unitpoint within the context to align the image with. The default is Center.

Discussion

The current context state defines the full drawing operation. For example, the current transformation and clip shapes affect how SwiftUI draws the image.