Serializable, Comparable<ScaleMode>public enum ScaleMode extends Enum<ScaleMode>
SystemCapability.Multimedia#IMAGE| 枚举常量 | 说明 |
|---|---|
CENTER_CROP |
Indicates the effect that scales an image to fill the target image area and center-crops
the part outside the area.
|
FIT_TARGET_SIZE |
Indicates the effect that fits the image into the target size.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getValue() |
Obtains the enum value of the image scaling effect.
|
static ScaleMode |
valueOf(String name) |
返回带有指定名称的该类型的枚举常量。
字符串必须与用于声明该类型的枚举常量的
标识符完全匹配。(不允许有多余
的空格字符。)
|
static ScaleMode[] |
values() |
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。该方法可用于迭代
常量, 如下所示:
for (ScaleMode c : ScaleMode.values()) System.out.println(c); |
public static final ScaleMode FIT_TARGET_SIZE
The image will be stretched when target aspect ratio differs from the original.
public static final ScaleMode CENTER_CROP
The original image will be scaled up or down at the original aspect ratio to fill the target dimensions, and any additional height or width that does not fit will be cropped out from each side. For example to scale a 200 x 100 image to 500 x 300, the effect scales the image to 600 x 300, centers the image horizontally, and then crops out the extra 50 pixels of width from each side.
public static ScaleMode[] values()
for (ScaleMode c : ScaleMode.values()) System.out.println(c);
public static ScaleMode valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public int getValue()