A type that specifies image size and aspect ratio information.
The Image Playground framework supports the creation of images with a finite set
of sizes and aspect ratios. To request an image of a particular size, call the
static ``closest(to:)`` method to create an instance of this structure. That method
creates a structure with a supported size that most closely matches the size
information you provided. The method considers both the resolution and aspect
ratio you specified.
Assign an instance of this structure to the ``ImagePlaygroundOptions/sizeSpecification``
property of your options, and use those options to generate your image.
Members (1)
static · iOS 27.0+
closest
TypeScript
static closest(size: { width: number; height: number }): ImagePlaygroundOptions_SizeSpecification
Creates a new instance of this structure with a size value that best matches
the specified size.
- Parameters:
- size: The image size you want.
- Returns: A structure with a supported size that most closely matches the
requested value in `size`.
This method finds the supported image size that’s closest to the value in the
`size` parameter. The method considers both the resolution and aspect ratio
of the requested size when choosing the output size.