Function load_image_from_source

Source
pub fn load_image_from_source(
    source: &ImageSource,
) -> Result<ImageData, ImageError>
Expand description

Decodes an image from a given ImageSource.

This function handles the loading and decoding of the image data into a format suitable for rendering. It should be called outside of the main UI loop or a component’s measure closure to avoid performance degradation from decoding the image on every frame.

§Arguments

  • source - A reference to the ImageSource to load the image from.

§Returns

A Result containing the decoded ImageData on success, or an image::ImageError on failure.