#[repr(u32)]pub enum ImageFit {
Fill = 0,
Contain = 1,
Cover = 2,
Preserve = 3,
}
Expand description
This enum defines how the source image shall fit into an Image
element.
Variants§
Fill = 0
Scales and stretches the source image to fit the width and height of the Image
element.
Contain = 1
The source image is scaled to fit into the Image
element’s dimension while preserving the aspect ratio.
Cover = 2
The source image is scaled to cover into the Image
element’s dimension while preserving the aspect ratio.
If the aspect ratio of the source image doesn’t match the element’s one, then the image will be clipped to fit.
Preserve = 3
Preserves the size of the source image in logical pixels. The source image will still be scaled by the scale factor that applies to all elements in the window. Any extra space will be left blank.
Trait Implementations§
impl Copy for ImageFit
impl Eq for ImageFit
impl StructuralPartialEq for ImageFit
Auto Trait Implementations§
impl Freeze for ImageFit
impl RefUnwindSafe for ImageFit
impl Send for ImageFit
impl Sync for ImageFit
impl Unpin for ImageFit
impl UnwindSafe for ImageFit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Converts the given value to a
SharedString
.