sealed class Tinman.Engine.GUI.Components.ImageView

Derived from

Component abstract

Displays an image.

Public / Constants


public static readonly attribute Class → (StyleClass)

The style class for ImageView.

Public / Constructors


public constructor ImageView → (2)

imageHandle opt : IResourceHandle = null

Initial value of ImageHandle.

imageTint opt : bool = false

Initial value of ImageTint.

Creates a new instance of ImageView.

Public / Attributes


public attribute Image → (get,set)

value : Bitmap

The image resource.

The image resource.

Settings the image resource will reset the image resource handle to null (see ImageHandle).

See also



public attribute ImageCanvasOffset → (get)

value : Vec2I

The image canvas offset.

Returns the current offset of the image canvas.


public attribute ImageCanvasSize → (get)

value : Vec2I

The image canvas size.

Returns the current size of the image canvas.


public attribute ImageFit → (get,set)

value : int32

The image fit mode:
0 : adjust layout size with image size and center in resulting size
1 : scale image uniformly and center in layout size
2 : stretch image to layout size.

Specifies the mode to use for fitting the image into the layout size.

Defaults to 0.


public attribute ImageFitAspectRatio → (get,set)

value : float64

The aspect ratio or 0 to disable.

When the image is stretched to the layout size (see ImageFit), this aspect ratio will be used to determine the height of the image canvas, based on the available horizontal space.

Defaults to 0.


public attribute ImageHandle → (get,set)

value : IResourceHandle

The image resource handle.

The image resource handle.

See also



public attribute ImageTint → (get,set)

value : bool

true to modulate the image with the tint color,
false to draw the original image.

Use the tint color to modulate the image?

Defaults to false


public attribute ImageTintColor → (get,set)

value : int64

The tint color to use. If 0, Style.ForegroundColor will be used instead.

The color to use for tinting the image.

Defaults to 0.