[]
Serializable, Comparable<BackgroundImageLayout>, Constable该枚举与 IRange.setBackgroundImageLayout(BackgroundImageLayout)配合使用,用于控制区域背景图像的显示方式。支持的布局方式包括:拉伸图像、居中图像、在保留纵横比的同时适应区域大小,或将图像放置在左上角且不进行缩放。IRange.getBackgroundImageLayout() 返回的默认布局为 Stretch。
IRange range = worksheet.getRange("A1:C3");
byte[] backgroundImage = new byte[] {
(byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x08, 0x06, 0x00, 0x00, 0x00, 0x1F, 0x15, (byte) 0xC4,
(byte) 0x89, 0x00, 0x00, 0x00, 0x0A, 0x49, 0x44, 0x41,
0x54, 0x78, (byte) 0x9C, 0x63, 0x00, 0x01, 0x00, 0x00,
0x05, 0x00, 0x01, 0x0D, 0x0A, 0x2D, (byte) 0xB4,
0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44,
(byte) 0xAE, 0x42, 0x60, (byte) 0x82
};
range.setBackgroundImage(backgroundImage);
range.setBackgroundImageLayout(BackgroundImageLayout.Zoom);
Enum.EnumDesc<E extends Enum<E>>static BackgroundImageLayoutintgetValue()static BackgroundImageLayoutstatic BackgroundImageLayout[]values()name - the name of the enum constant to be returned.IllegalArgumentException - if this enum class has no constant with the specified nameNullPointerException - if the argument is null此方法返回当前 BackgroundImageLayout 常量的序数值。
使用此方法可将 getValue() 返回的整数值转换回对应的 BackgroundImageLayout 常量。
value - 表示枚举常量的整数值。BackgroundImageLayout 枚举常量。NullPointerException - 如果 value 为 null。ArrayIndexOutOfBoundsException - 如果 value 不对应有效的枚举常量。