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

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 GraphicsContext.ResolvedImage to draw. Get a resolved image from an Image by calling resolve(_:). Alternatively, you can call draw(_:at:anchor:) 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 an Image