com.aspose.words

Class ImageType

  • java.lang.Object
    • com.aspose.words.ImageType
public class ImageType 
extends java.lang.Object

Utility class containing constants. Specifies the type (format) of an image in a Microsoft Word document.

Example:

Shows how to add an image to a shape and check its type.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

BufferedImage image = ImageIO.read(getAsposelogoUri().toURL().openStream());

// The image in the URL is a .gif. Inserting it into a document converts it into a .png.
Shape imgShape = builder.insertImage(image);
Assert.assertEquals(imgShape.getImageData().getImageType(), ImageType.PNG);
See Also:
ImageData.ImageType

Field Summary
static final intNO_IMAGE = 0
The is no image data.
static final intUNKNOWN = 1
An unknown image type or image type that cannot be directly stored inside a Microsoft Word document.
static final intEMF = 2
Windows Enhanced Metafile.
static final intWMF = 3
Windows Metafile.
static final intPICT = 4
Macintosh PICT. An existing image will be preserved in a document, but inserting new PICT images into a document is not supported.
static final intJPEG = 5
JPEG JFIF.
static final intPNG = 6
Portable Network Graphics.
static final intBMP = 7
Windows Bitmap.
 

    • Field Detail

      • NO_IMAGE = 0

        public static final int NO_IMAGE
        The is no image data.
      • UNKNOWN = 1

        public static final int UNKNOWN
        An unknown image type or image type that cannot be directly stored inside a Microsoft Word document.
      • EMF = 2

        public static final int EMF
        Windows Enhanced Metafile.
      • WMF = 3

        public static final int WMF
        Windows Metafile.
      • PICT = 4

        public static final int PICT
        Macintosh PICT. An existing image will be preserved in a document, but inserting new PICT images into a document is not supported.
      • JPEG = 5

        public static final int JPEG
        JPEG JFIF.
      • PNG = 6

        public static final int PNG
        Portable Network Graphics.
      • BMP = 7

        public static final int BMP
        Windows Bitmap.