The image is stretched in 9-segments defined by the Scale9Margin. Corners are not stretched, borders are stretced in one direction, the center is stretched in both directions.

Location

Namespace
Fuse.Elements
Package
Fuse.Elements 1.9.0

Returns

StretchMode

Possible Values

PointPrecise

The size of the source image, in points calculated with density, are used as the image size. This is the default: a 100x50 source image will be 100x50 points in size. This preserves size across various device densities.

PixelPrecise

The size is pixel matched to the source so the image is drawn 1:1. This means the visual size changes across device densities, but the image remains sharp.

PointPrefer

If the size of the image in PixelPrecise mode is close to PointPrecise then use PixelPrecise mode, otherwise use PointPrecise mode. This retains sharpness with slightly varying sizes, but prevents too much size variation.

Fill

The image is stretched to fill the available space. The aspect ratio is not retained.

Scale9

The image is stretched in 9-segments defined by the Scale9Margin. Corners are not stretched, borders are stretced in one direction, the center is stretched in both directions.

Uniform

Stretches the image to touch the sides of the available space and retain the aspect ratio. This will result in unfilled sections on either the left/right or top/bottom sides of the image.

UniformToFill

Stretches an image to touch all sides of the available space and retain the aspect ratio. This will result in the image being clipped on the left/right or top/bottom.