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
FocusedRenderable
Gets or sets the renderable to display when the image widget has focus.
[StylePropertyPath("FocusedImage")]
public IImage FocusedRenderable { get; set; }
Property Value
IsAnisotropicFiltering
Gets or sets a value indicating whether anisotropic filtering is applied to the image.
public bool IsAnisotropicFiltering { get; set; }
Property Value
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
PressedRenderable
Gets or sets the renderable to display when the image widget is pressed.
[StylePropertyPath("PressedImage")]
public IImage PressedRenderable { get; set; }
Property Value
Renderable
Gets or sets the renderable to display in the image widget's normal state.
[StylePropertyPath("Image")]
public IImage Renderable { get; set; }
Property Value
ResizeMode
Gets or sets how the image is resized to fit available space.
public ImageResizeMode ResizeMode { get; set; }
Property Value
Methods
ApplyImageStyle(ImageStyle)
Applies the specified pressable image style to this image.
public void ApplyImageStyle(ImageStyle style)
Parameters
styleImageStyleThe pressable image style to apply.
ApplyStyle(WidgetStyle)
Applies the specified widget style to this image.
protected override void ApplyStyle(WidgetStyle style)
Parameters
styleWidgetStyleThe widget style to apply.
CopyFrom(Widget)
Copies all properties from another widget to this image.
protected override void CopyFrom(Widget w)
Parameters
wWidgetThe 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
availableSizePointThe 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
contextRenderContextThe render context to draw with.