pub struct ImageProps {
pub source: ImageSource,
pub decorative: bool,
pub content_mode: ContentMode,
pub aspect_ratio: Option<f64>,
pub tint: Option<Color>,
pub template: bool,
}Fields§
§source: ImageSourceWhich pixels to draw: a staged asset name, encoded bytes, or an already-decoded
image (ImageSource, docs/images.md). A name resolves through the backend’s own
pipeline (§18.2); bytes and decoded ids need Cap::ImageDecode, and a backend
without it draws nothing rather than guessing.
decorative: bool§content_mode: ContentModeHow the image scales within its frame (default ContentMode::Fit, no stretching).
aspect_ratio: Option<f64>Optional width:height ratio the view is constrained to (e.g. 16.0/9.0). None lets the
image take its allocated frame.
tint: Option<Color>Monochrome tint for a template/vector glyph (docs/vectors.md): backends that can,
recolor natively (template rendering on Apple, drawable tint on Android, pixel
recolor on GTK); backends that can’t yet ignore it and draw the source colors.
None (the default, and every raster image(…)) means “as authored”.
template: boolA monochrome template glyph (docs/vectors.md “Template”): with no tint, it draws
in the foreground of the surface it sits on — the theme’s label color on the
desktops, the cell’s tint on UIKit, currentColor on the web — and follows a
theme switch. What a sidebar row’s untinted icon is: a tinted glyph recolors the
same way with or without this, and false (the default) draws an untinted glyph as
authored. ImagePatch::Tint(None) on a template returns to that foreground,
not to the authored colors.
Trait Implementations§
Source§impl Clone for ImageProps
impl Clone for ImageProps
Source§fn clone(&self) -> ImageProps
fn clone(&self) -> ImageProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more