Instance Method インスタンスメソッド

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 GraphicsContext.ResolvedImage by calling resolve(_:).

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 an Image