Trait ImageExt
pub trait ImageExt: LayoutExt {
// Required method
fn get_image_data(&mut self) -> &mut ImageData;
// Provided methods
fn image_data(self, image_data: ImageData) -> Self { ... }
fn sampling_mode(self, sampling_mode: SamplingMode) -> Self { ... }
fn aspect_ratio(self, aspect_ratio: AspectRatio) -> Self { ... }
fn image_cover(self, image_cover: ImageCover) -> Self { ... }
}Expand description
Methods for configuring how an image is scaled and sampled.
Required Methods§
fn get_image_data(&mut self) -> &mut ImageData
fn get_image_data(&mut self) -> &mut ImageData
Returns a mutable reference to the element’s image data.
Provided Methods§
fn image_data(self, image_data: ImageData) -> Self
fn image_data(self, image_data: ImageData) -> Self
Replace all of the element’s image data at once. See ImageData.
fn sampling_mode(self, sampling_mode: SamplingMode) -> Self
fn sampling_mode(self, sampling_mode: SamplingMode) -> Self
Set the filtering used when the image is scaled. See SamplingMode.
fn aspect_ratio(self, aspect_ratio: AspectRatio) -> Self
fn aspect_ratio(self, aspect_ratio: AspectRatio) -> Self
Set how the image is scaled to fit its bounds. See AspectRatio.
fn image_cover(self, image_cover: ImageCover) -> Self
fn image_cover(self, image_cover: ImageCover) -> Self
Set how the image is positioned within its bounds. See ImageCover.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.