pub fn image(args: impl Into<ImageArgs>)Expand description
§image
Renders a raster image, fitting it to the available space or its intrinsic size.
§Usage
Display a static asset or a dynamically loaded image from a file or memory.
§Parameters
args— configures the image data and layout; seeImageArgs.
§Examples
use std::sync::Arc;
use tessera_ui_basic_components::image::{
image, load_image_from_source, ImageArgsBuilder, ImageSource,
};
// In a real app, you might load image bytes from a file at runtime.
// For this example, we include the bytes at compile time.
let image_bytes = Arc::new(*include_bytes!("../../assets/counter.png"));
let image_data = load_image_from_source(&ImageSource::Bytes(image_bytes))
.expect("Failed to load image");
// Render the image using its loaded data.
image(image_data);