Contents

draw(_:at:anchor:)

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

Declaration

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

Parameters

  • image:

    The Resolvedimage to draw. Get a resolved image from an Image by calling Resolve(_:) 898z6. Alternatively, you can call Draw(_:at:anchor:) 7l217 with an Image, and that method performs the resolution automatically.

  • 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.

See Also

Drawing images, text, and views