ImageSaveOptionsMetafileRenderingOptions Property

Allows to specify how metafiles are treated in the rendered output.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public MetafileRenderingOptions MetafileRenderingOptions { get; }

Property Value

Type: MetafileRenderingOptions
Remarks

When Vector is specified, Aspose.Words renders metafile to vector graphics using its own metafile rendering engine first and then renders vector graphics to the image.

When Bitmap is specified, Aspose.Words renders metafile directly to the image using the GDI+ metafile rendering engine.

GDI+ metafile rendering engine works faster, supports almost all metafile features but on low resolutions may produce inconsistent result when compared to the rest of vector graphics (especially for text) on the page. Aspose.Words metafile rendering engine will produce more consistent result even on low resolutions but works slower and may inaccurately render complex metafiles.

The default value for MetafileRenderingMode is Bitmap.

Examples
Shows how to set the rendering mode for Windows Metafiles.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Use a DocumentBuilder to insert a .wmf image into the document
builder.InsertImage(Image.FromFile(ImageDir + "Windows MetaFile.wmf"));

// For documents that contain .wmf images, when converting the documents themselves to images,
// we can use a ImageSaveOptions object to designate a rendering method for the .wmf images
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Png);
options.MetafileRenderingOptions.RenderingMode = MetafileRenderingMode.Bitmap;

doc.Save(ArtifactsDir + "ImageSaveOptions.WindowsMetaFile.png", options);
See Also