Struct Fit
sealed struct Fit
Options for scaling the bounds of an IImage to the bounds of IImageView.
Fields
Constants
COVER
Scale theFit={0}
IImage uniformly (maintain the aspect ratio) so that both dimensions (width and height) of the IImage
will be equal to or larger than the corresponding dimension of the IImageView.
CONTAIN
Scale theFit={1}
IImage uniformly (maintain the aspect ratio) so that both dimensions (width and height)
of the IImage will be equal to or less than the corresponding dimension of the IImageView.
STRETCH
Scale width and height independently (without maintaining the aspect ratio).Fit={2}
REPEAT
Repeat theFit={3}
IImage to cover the frame of the IImageView.
The IImage will keep its size and aspect ratio, unless it is larger than the IImageView,
in which case it will be scaled down uniformly so that it is contained in the IImageView.
CENTER
Center theFit={4}
IImage in the IImageView along both dimensions.
If the IImage is larger than the view, scale it down uniformly so that it is contained in the IImageView.
NONE
TheFit={5}
IImage is not resized and is displayed at its original size,
anchored to the top-left of the IImageView. This is useful when
pixel-exact rendering is needed, such as icons or pre-rendered assets.
If the image dimensions are greater than the IImageView dimensions,
the image will be clipped to the IImageView bounds.
If the image is smaller than the IImageView, the remaining area is not painted
and remains transparent.
SCALE_DOWN
Scales theFit={6}
IImage uniformly (preserving the aspect ratio) to fit within
the IImageView dimensions only if the image is larger than the view.
If the image is smaller than or equal to the view, it is displayed at its original size,
anchored to the top-left of the IImageView.
This behaves like Fit::NONE, but scales down if the image exceeds the view bounds.
