[]
        
(Showing Draft Content)

ImageType

Enum Class ImageType

java.lang.Object
java.lang.Enum<ImageType>
com.grapecity.documents.excel.drawing.ImageType
All Implemented Interfaces:
Serializable, Comparable<ImageType>, Constable

public enum ImageType extends Enum<ImageType>
Specifies the image format used by APIs that import, fill, or export images.

Use this enum to indicate the format of image data when working with drawing-related APIs, such as adding a picture from a stream or exporting a shape as an image.


 IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 10, 10, 80, 40);
 ByteArrayOutputStream stream = new ByteArrayOutputStream();
 shape.toImage(stream, ImageType.PNG);
 
  • Enum Constant Details

    • PNG

      public static final ImageType PNG
      Indicates a PNG image.
    • JPG

      public static final ImageType JPG
      Indicates a JPG image.
    • JPEG

      public static final ImageType JPEG
      Indicates a JPEG image.
    • EMF

      public static final ImageType EMF
      Indicates an EMF (Enhanced Metafile) image.
    • GIF

      public static final ImageType GIF
      Indicates a GIF image.
    • WMF

      public static final ImageType WMF
      Indicates a WMF image.
    • SVG

      public static final ImageType SVG
      Indicates an SVG (Scalable Vector Graphics) image.
  • Method Details

    • values

      public static ImageType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ImageType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null