Contents

init(_:scale:orientation:label:)

Creates a labeled image based on a Core Graphics image instance, usable as content for controls.

Declaration

init(_ cgImage: CGImage, scale: CGFloat, orientation: Image.Orientation = .up, label: Text)

Parameters

  • cgImage:

    The base graphical image.

  • scale:

    The scale factor for the image, with a value like 1.0, 2.0, or 3.0.

  • orientation:

    The orientation of the image. The default is Up.

  • label:

    The label associated with the image. SwiftUI uses the label for accessibility.

See Also

Creating an image for use as a control