Class EmfRasterizationOptions

Class EmfRasterizationOptions

Namespace: Aspose.Imaging.ImageOptions
Assembly: Aspose.Imaging.dll (25.4.0)

The Emf rasterization options.

public class EmfRasterizationOptions : MetafileRasterizationOptions, IDisposable, IHasXmpData, IHasMetadata, ICloneable

Inheritance

objectDisposableObjectImageOptionsBaseVectorRasterizationOptionsMetafileRasterizationOptionsEmfRasterizationOptions

Implements

IDisposable, IHasXmpData, IHasMetadata, ICloneable

Inherited Members

VectorRasterizationOptions.CopyTo(VectorRasterizationOptions), VectorRasterizationOptions.BorderX, VectorRasterizationOptions.BorderY, VectorRasterizationOptions.CenterDrawing, VectorRasterizationOptions.PageHeight, VectorRasterizationOptions.PageSize, VectorRasterizationOptions.PageWidth, VectorRasterizationOptions.BackgroundColor, VectorRasterizationOptions.DrawColor, VectorRasterizationOptions.SmoothingMode, VectorRasterizationOptions.TextRenderingHint, VectorRasterizationOptions.Positioning, VectorRasterizationOptions.ReplaceTextMapping, ImageOptionsBase.Clone(), ImageOptionsBase.ReleaseManagedResources(), ImageOptionsBase.KeepMetadata, ImageOptionsBase.XmpData, ImageOptionsBase.Source, ImageOptionsBase.Palette, ImageOptionsBase.ResolutionSettings, ImageOptionsBase.VectorRasterizationOptions, ImageOptionsBase.BufferSizeHint, ImageOptionsBase.MultiPageOptions, ImageOptionsBase.FullFrame, ImageOptionsBase.ProgressEventHandler, DisposableObject.Dispose(), DisposableObject.ReleaseManagedResources(), DisposableObject.ReleaseUnmanagedResources(), DisposableObject.VerifyNotDisposed(), DisposableObject.Disposed, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

EmfRasterizationOptions()

public EmfRasterizationOptions()

Properties

RenderMode

Gets or sets the render mode.

public EmfRenderMode RenderMode { get; set; }

Property Value

EmfRenderMode

Examples

This example shows how to load a EMF image from a file and convert it to SVG using EmfRasterizationOptions.

string dir = "c:\\temp\\";

                                                                                                                      // Using Aspose.Imaging.Image.Load is a unified way to load all types of images including EMF.
                                                                                                                      using (Aspose.Imaging.FileFormats.Emf.EmfImage emfImage = (Aspose.Imaging.FileFormats.Emf.EmfImage)Aspose.Imaging.Image.Load(dir + "test.emf"))
                                                                                                                      {
                                                                                                                          Aspose.Imaging.ImageOptions.SvgOptions saveOptions = new Aspose.Imaging.ImageOptions.SvgOptions();

                                                                                                                          // Text will be converted to shapes.
                                                                                                                          saveOptions.TextAsShapes = true;

                                                                                                                          Aspose.Imaging.ImageOptions.EmfRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.EmfRasterizationOptions();

                                                                                                                          // The background color of the drawing surface.
                                                                                                                          rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.WhiteSmoke;

                                                                                                                          // The page size.
                                                                                                                          rasterizationOptions.PageSize = emfImage.Size;

                                                                                                                          // If embedded emf exists, then render emf; otherwise render wmf.
                                                                                                                          rasterizationOptions.RenderMode = Aspose.Imaging.FileFormats.Emf.EmfRenderMode.Auto;

                                                                                                                          // Set the horizontal margin
                                                                                                                          rasterizationOptions.BorderX = 50;

                                                                                                                          // Set the vertical margin
                                                                                                                          rasterizationOptions.BorderY = 50;

                                                                                                                          saveOptions.VectorRasterizationOptions = rasterizationOptions;

                                                                                                                          emfImage.Save(dir + "test.output.svg", saveOptions);
                                                                                                                      }

Methods

CopyTo(VectorRasterizationOptions)

Copies this to vectorRasterizationOptions.

public override void CopyTo(VectorRasterizationOptions vectorRasterizationOptions)

Parameters

vectorRasterizationOptions VectorRasterizationOptions

vectorRasterizationOptions