public class ImageType
extends java.lang.Object
Examples:
Shows how to read WebP image.
Document doc = new Document(getMyDir() + "Document with WebP image.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Assert.assertEquals(ImageType.WEB_P, shape.getImageData().getImageType());
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);
ImageData.getImageType()| Modifier and Type | Field and Description |
|---|---|
static int |
BMP
Windows Bitmap.
|
static int |
EMF
Windows Enhanced Metafile.
|
static int |
EPS
Encapsulated PostScript.
|
static int |
GIF
GIF
|
static int |
JPEG
JPEG JFIF.
|
static int |
length |
static int |
NO_IMAGE
The is no image data.
|
static int |
PICT
Macintosh PICT.
|
static int |
PNG
Portable Network Graphics.
|
static int |
UNKNOWN
An unknown image type or image type that cannot be directly stored inside a Microsoft Word document.
|
static int |
WEB_P
WebP.
|
static int |
WMF
Windows Metafile.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String imageTypeName) |
static java.lang.String |
getName(int imageType) |
static int[] |
getValues() |
static java.lang.String |
toString(int imageType) |
public static int NO_IMAGE
public static int UNKNOWN
public static int EMF
public static int WMF
public static int PICT
public static int JPEG
public static int PNG
public static int BMP
public static int EPS
public static int WEB_P
public static int GIF
public static int length