Table of Contents

Interface IImage

Namespace
Xui.Core.Canvas
Assembly
Xui.Core.dll

Represents a decoded, GPU-resident image. Acts as a self-loading resource handle — analogous to HTMLImageElement in the browser.

Acquire instances via GetService(typeof(IImage)) on any View. Then set the source with Load(string) (sync-if-cached) or LoadAsync(string) for first-time remote or large assets.

public interface IImage

Properties

Size

Intrinsic size of the image in points. Returns Empty until loaded.

Size Size { get; }

Property Value

Size

Methods

Load(string)

Loads the image from uri. Returns immediately if the image is already in the platform catalog. For local packaged assets this may block on first call; prefer LoadAsync(string) for anything that could be slow.

void Load(string uri)

Parameters

uri string

LoadAsync(string)

Loads the image from uri on a background thread. The returned task completes once the image is decoded and GPU-resident. Subsequent Load(string) calls with the same URI return instantly from cache.

Task LoadAsync(string uri)

Parameters

uri string

Returns

Task