[]
Serializable, Comparable<BackgroundImageLayout>, ConstableUse this enum with IRange.setBackgroundImageLayout(BackgroundImageLayout) to control how a range's background image is displayed. Supported layouts can stretch the image, center it, fit it while preserving its aspect ratio, or place it at the top-left corner without resizing. The default layout returned by IRange.getBackgroundImageLayout() is 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 nullThis method returns the ordinal value of the current BackgroundImageLayout constant.
Use this method to convert an integer value returned by getValue() back to its corresponding BackgroundImageLayout constant.
value - The integer value representing the enum constant.BackgroundImageLayout enum constant corresponding to the specified value.NullPointerException - if value is null.ArrayIndexOutOfBoundsException - if value does not correspond to a valid enum constant.