init(image:frame:rotation:orientation:opacity:contentsBounds:accessibilityDescription:allowedInteractions:id:)
Initializes and returns a new image markup from the specified parameters.
Declaration
init(image: CGImage, frame: CGRect, rotation: CGFloat = 0.0, orientation: CGImagePropertyOrientation = .up, opacity: CGFloat = 1.0, contentsBounds: CGRect = CGRect(x: 0, y: 0, width: 1, height: 1), accessibilityDescription: String? = nil, allowedInteractions: MarkupInteractions = .all, id: MarkupID<ImageMarkup> = MarkupID())Parameters
- image:
The image content to display.
- frame:
The frame of the image.
- rotation:
The rotation in radians of the image. Defaults to
0.0(no rotation). - orientation:
The orientation of the image content. Defaults to
.up(no rotation). - opacity:
The opacity of the image, ranging from
0.0(fully transparent) to1.0(fully opaque). Defaults to1.0. - contentsBounds:
The portion of the image to display, in normalized coordinates from
0.0to1.0. Defaults toCGRect(x: 0, y: 0, width: 1, height: 1)(full image). - accessibilityDescription:
The accessibility description of the image for assistive technologies. Defaults to
nil. - allowedInteractions:
The flags controlling the interactions users can perform. Defaults to
.all. - id:
The identity of the image. Defaults to a unique id.
Discussion
Image content is shown scaled to fill.