ImageType enumeration

ImageType enumeration

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

Members

NameDescription
NO_IMAGEThe is no image data.
UNKNOWNAn unknown image type or image type that cannot be directly stored inside a Microsoft Word document.
EMFWindows Enhanced Metafile.
WMFWindows Metafile.
PICTMacintosh PICT. An existing image will be preserved in a document, but inserting new PICT images into a document is not supported.
JPEGJPEG JFIF.
PNGPortable Network Graphics.
BMPWindows Bitmap.
EPSEncapsulated PostScript.
WEB_PWebP.
GIFGIF

Examples

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

doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
img_shape = builder.insert_image(file_name=IMAGE_DIR + 'Logo.jpg')
self.assertEqual(aw.drawing.ImageType.JPEG, img_shape.image_data.image_type)

Shows how to read WebP image.

doc = aw.Document(file_name=MY_DIR + 'Document with WebP image.docx')
shape = doc.get_child(aw.NodeType.SHAPE, 0, True).as_shape()
self.assertEqual(aw.drawing.ImageType.WEB_P, shape.image_data.image_type)

See Also