Table of Contents

Class ImageElement

Namespace
Stride.UI.Controls
Assembly
Stride.UI.dll

Represents a control that displays an image.

[DataContract("ImageElement")]
public class ImageElement : UIElement, IUIElementUpdate, IUIElementChildren, IIdentifiable
Inheritance
ImageElement
Implements
Inherited Members
Extension Methods

Properties

Color

Gets or set the color used to tint the image. Default value is White/>.

[DataMember]
[Display(null, "Appearance")]
public Color Color { get; set; }

Property Value

Color

Remarks

The initial image color is multiplied by this color.

Source

Gets or sets the ISpriteProvider for the image.

[DataMember]
[Display(null, "Appearance")]
public ISpriteProvider Source { get; set; }

Property Value

ISpriteProvider

StretchDirection

Gets or sets a value that indicates how the image is scaled.

[DataMember]
[Display(null, "Layout")]
public StretchDirection StretchDirection { get; set; }

Property Value

StretchDirection

StretchType

Gets or sets a value that describes how the image should be stretched to fill the destination rectangle.

[DataMember]
[Display(null, "Layout")]
public StretchType StretchType { get; set; }

Property Value

StretchType

Methods

ArrangeOverride(Vector3)

When overridden in a derived class, positions possible child elements and determines a size for a UIElement derived class.

protected override Vector3 ArrangeOverride(Vector3 finalSizeWithoutMargins)

Parameters

finalSizeWithoutMargins Vector3

The final area within the parent that this element should use to arrange itself and its children.

Returns

Vector3

The actual size used.

MeasureOverride(Vector3)

When overridden in a derived class, measures the size in layout required for possible child elements and determines a size for the UIElement-derived class.

protected override Vector3 MeasureOverride(Vector3 availableSizeWithoutMargins)

Parameters

availableSizeWithoutMargins Vector3

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Vector3

The size desired by the children

Update(GameTime)

Method called by Update(GameTime). This method can be overridden by inherited classes to perform time-based actions. This method is not in charge to recursively call the update on child elements, this is automatically done.

protected override void Update(GameTime time)

Parameters

time GameTime

The current time of the game