ComponentContentScaleMode class

Specifies how a component's content is scaled to fit the component bounds.

Signature:

export declare abstract class ComponentContentScaleMode 

Properties

PropertyModifiersTypeDescription
Crop

static

readonly

(not declared)Scales the component's content so that the entire component's area is covered by content while maintaining the content aspect ratio. The content may be cropped.
Fit

static

readonly

(not declared)Scales the component's content so that it fits entirely within its bounds while maintaining the content aspect ratio. This may leave some blank space around the content which is filled according to the specified ComponentContentFillMode.
Stretch

static

readonly

(not declared)Fits the component's content in its bounds without keeping its aspect ratio. May result in non-uniform scaling.

ComponentContentScaleMode.Crop property

Scales the component's content so that the entire component's area is covered by content while maintaining the content aspect ratio. The content may be cropped.

Signature:

static readonly Crop = 0;

ComponentContentScaleMode.Fit property

Scales the component's content so that it fits entirely within its bounds while maintaining the content aspect ratio. This may leave some blank space around the content which is filled according to the specified ComponentContentFillMode.

Signature:

static readonly Fit = 1;

ComponentContentScaleMode.Stretch property

Fits the component's content in its bounds without keeping its aspect ratio. May result in non-uniform scaling.

Signature:

static readonly Stretch = 2;