Class ImageSize
Immutable image sizing intent. Exact pixels and resolution presets are distinct requests; providers reject unsupported kinds instead of silently approximating dimensions.
public sealed class ImageSize
- Inheritance
-
ImageSize
- Inherited Members
Properties
AspectRatio
Requested aspect ratio in Preset mode; Auto for other modes.
public ImageAspectRatio AspectRatio { get; }
Property Value
Auto
Let the provider select the output size.
public static ImageSize Auto { get; }
Property Value
Height
Requested height in Pixels mode; zero for other modes.
public int Height { get; }
Property Value
Kind
The sizing mode selected by the factory.
public ImageSizeKind Kind { get; }
Property Value
Resolution
Requested resolution grade in Preset mode; Auto for other modes.
public ImageResolution Resolution { get; }
Property Value
Width
Requested width in Pixels mode; zero for other modes.
public int Width { get; }
Property Value
Methods
Pixels(int, int)
Request exact positive pixel dimensions. Model-specific bounds are validated by the provider. Providers that only support resolution grades reject this mode.
public static ImageSize Pixels(int width, int height)
Parameters
Returns
Preset(ImageResolution, ImageAspectRatio)
Request a provider resolution grade and optional aspect ratio. Auto resolution can be used to request only a ratio. Actual pixel dimensions remain provider-selected.
public static ImageSize Preset(ImageResolution resolution, ImageAspectRatio aspectRatio = ImageAspectRatio.Auto)
Parameters
resolutionImageResolutionaspectRatioImageAspectRatio