Skip to main content

Image Class

NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls

Summary description for Image.

public class Image : UIElement

Properties​

Stretch​

public Stretch Stretch { get; set; }

How the image is scaled to fill the control.

Source​

public ImageSource Source { get; set; }

The image to display.

TransparentColor​

public int TransparentColor { get; set; }

A color key (0xRRGGBB) rendered as transparent, e.g. an icon's magenta backdrop (0xFF00F2). The default -1 means no key (the image draws opaque). Order-independent: setting either this or Source (re)applies the key.

Methods​

MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)​

protected override void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

Measures the desired size based on the image and stretch mode.

OnRender(DrawingContext dc)​

public override void OnRender(DrawingContext dc)

Draws the image using the current stretch mode.