ImageFit Enum

用于确定图像在显示时的尺寸和比例

Used to determine the size and scale of the image when displayed

Properties

nametypedescription
Stretch按照原始大小进行拉伸以填充整个容器
Stretch to the original size to fill the entire container
Horizontal图像将水平填充容器
The image will horizontally fill the container
Vertical图像将垂直填充容器
The image will vertically fill the container
Smallest图像将被缩放到最小尺寸以满足容器的大小要求
The image will be scaled to the minimum size to meet the size requirements of the container
Biggest图像将被缩放到最大尺寸以满足容器的大小要求
The image will be scaled to the maximum size to meet the size requirements of the container
Size图像将被缩放到指定的宽度和高度值
The image will be scaled to the specified width and height values

Example

#![allow(unused)]
fn main() {
fit: Stretch,
fit: Vertical,
}