ImageType

ImageType enumeration

Specifies the type (format) of an image in a Microsoft Word document.

public enum ImageType

Values

NameValueDescription
NoImage0The is no image data.
Unknown1An unknown image type or image type that cannot be directly stored inside a Microsoft Word document.
Emf2Windows Enhanced Metafile.
Wmf3Windows Metafile.
Pict4Macintosh PICT. An existing image will be preserved in a document, but inserting new PICT images into a document is not supported.
Jpeg5JPEG JFIF.
Png6Portable Network Graphics.
Bmp7Windows Bitmap.
Eps8Encapsulated PostScript.

Examples

Shows how to read WebP image (only .NetStandard)

Document doc = new Document(MyDir + "Document with WebP image.docx");

Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
Assert.AreEqual(ImageType.WebP, shape.ImageData.ImageType);

Shows how to add an image to a shape and check its type.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape imgShape = builder.InsertImage(ImageDir + "Logo.jpg");
Assert.AreEqual(ImageType.Jpeg, imgShape.ImageData.ImageType);

See Also