Table of Contents

Class Image

Namespace
Myra.Graphics2D.UI
Assembly
Myra.dll

An image widget that displays a texture region with optional resize modes.

public class Image : Widget, IItemWithId, INotifyAttachedPropertyChanged
Inheritance
Image
Implements
Derived
Inherited Members

Properties

Color

Gets or sets the color multiplier applied when rendering the image.

public Color Color { get; set; }

Property Value

Color

DisabledRenderable

Gets or sets the renderable to display when the image widget is disabled.

[StylePropertyPath("DisabledImage")]
public IImage DisabledRenderable { get; set; }

Property Value

IImage

FocusedRenderable

Gets or sets the renderable to display when the image widget has focus.

[StylePropertyPath("FocusedImage")]
public IImage FocusedRenderable { get; set; }

Property Value

IImage

IsAnisotropicFiltering

Gets or sets a value indicating whether anisotropic filtering is applied to the image.

public bool IsAnisotropicFiltering { get; set; }

Property Value

bool

OverRenderable

Gets or sets the renderable to display when the mouse is over the image widget.

[StylePropertyPath("OverImage")]
public IImage OverRenderable { get; set; }

Property Value

IImage

PressedRenderable

Gets or sets the renderable to display when the image widget is pressed.

[StylePropertyPath("PressedImage")]
public IImage PressedRenderable { get; set; }

Property Value

IImage

Renderable

Gets or sets the renderable to display in the image widget's normal state.

[StylePropertyPath("Image")]
public IImage Renderable { get; set; }

Property Value

IImage

ResizeMode

Gets or sets how the image is resized to fit available space.

public ImageResizeMode ResizeMode { get; set; }

Property Value

ImageResizeMode

Methods

ApplyImageStyle(ImageStyle)

Applies the specified pressable image style to this image.

public void ApplyImageStyle(ImageStyle style)

Parameters

style ImageStyle

The pressable image style to apply.

ApplyStyle(WidgetStyle)

Applies the specified widget style to this image.

protected override void ApplyStyle(WidgetStyle style)

Parameters

style WidgetStyle

The widget style to apply.

CopyFrom(Widget)

Copies all properties from another widget to this image.

protected override void CopyFrom(Widget w)

Parameters

w Widget

The widget to copy properties from.

InternalMeasure(Point)

Measures the size required for the image, considering all image states (normal, over, pressed).

protected override Point InternalMeasure(Point availableSize)

Parameters

availableSize Point

The available size for the image.

Returns

Point

The measured size needed for the image.

InternalRender(RenderContext)

Renders the image with the appropriate state-based image (normal, over, or pressed).

public override void InternalRender(RenderContext context)

Parameters

context RenderContext

The render context to draw with.