One Logo Pool Ball
ImagePlayground · IOS API REFERENCE

ImagePlaygroundOptions.SizeSpecification

struct · iOS 27.0+ · SDK 27.1

struct SizeSpecification

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
Swift declaration
static func closest(to size: CGSize) -> 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.

Skipped declarations

No declarations were skipped in this snapshot.

All ImagePlayground types →