Class SvgRasterizationOptions

Class SvgRasterizationOptions

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

The SVG rasterization options.

public class SvgRasterizationOptions : VectorRasterizationOptions, IDisposable, IHasXmpData, IHasMetadata, ICloneable

Inheritance

objectDisposableObjectImageOptionsBaseVectorRasterizationOptionsSvgRasterizationOptions

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

SvgRasterizationOptions()

public SvgRasterizationOptions()

Properties

ScaleX

Gets or sets the scale x.

public float ScaleX { get; set; }

Property Value

float

Examples

This example shows how to load an SVG image from a file and rasterize it to PNG using various options.```csharp [C#]

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

                                                                                                             // Using Aspose.Imaging.Image.Load is a unified way to load image.
                                                                                                             using (Aspose.Imaging.FileFormats.Svg.SvgImage svgImage = (Aspose.Imaging.FileFormats.Svg.SvgImage)Aspose.Imaging.Image.Load(dir + "test.svg"))
                                                                                                             {
                                                                                                                 // In order to rasterize SVG we need to specify rasterization options.
                                                                                                                 Aspose.Imaging.ImageOptions.SvgRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions();

                                                                                                                 // Set default color of a background for an image. Default value is white.
                                                                                                                 rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.Gray;

                                                                                                                 // Set the page size
                                                                                                                 rasterizationOptions.PageSize = svgImage.Size;

                                                                                                                 // Antialiasing is applied to lines and curves and the edges of filled areas.
                                                                                                                 rasterizationOptions.SmoothingMode = Aspose.Imaging.SmoothingMode.AntiAlias;

                                                                                                                 // Each character is drawn using its antialiased glyph bitmap without hinting.
                                                                                                                 rasterizationOptions.TextRenderingHint = Aspose.Imaging.TextRenderingHint.AntiAlias;

                                                                                                                 // Reduce the image size 10 times, i.e. the output size will be 10% of the original size.
                                                                                                                 rasterizationOptions.ScaleX = 0.1f;
                                                                                                                 rasterizationOptions.ScaleY = 0.1f;

                                                                                                                 Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
                                                                                                                 saveOptions.VectorRasterizationOptions = rasterizationOptions;

                                                                                                                 // Save to a PNG file
                                                                                                                 svgImage.Save(dir + "test.output.png", saveOptions);
                                                                                                             }

### <a id="Aspose_Imaging_ImageOptions_SvgRasterizationOptions_ScaleY"></a> ScaleY

Gets or sets the scale y.

```csharp
public float ScaleY { get; set; }

Property Value

float

Examples

This example shows how to load an SVG image from a file and rasterize it to PNG using various options.```csharp [C#]

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

                                                                                                             // Using Aspose.Imaging.Image.Load is a unified way to load image.
                                                                                                             using (Aspose.Imaging.FileFormats.Svg.SvgImage svgImage = (Aspose.Imaging.FileFormats.Svg.SvgImage)Aspose.Imaging.Image.Load(dir + "test.svg"))
                                                                                                             {
                                                                                                                 // In order to rasterize SVG we need to specify rasterization options.
                                                                                                                 Aspose.Imaging.ImageOptions.SvgRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions();

                                                                                                                 // Set default color of a background for an image. Default value is white.
                                                                                                                 rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.Gray;

                                                                                                                 // Set the page size
                                                                                                                 rasterizationOptions.PageSize = svgImage.Size;

                                                                                                                 // Antialiasing is applied to lines and curves and the edges of filled areas.
                                                                                                                 rasterizationOptions.SmoothingMode = Aspose.Imaging.SmoothingMode.AntiAlias;

                                                                                                                 // Each character is drawn using its antialiased glyph bitmap without hinting.
                                                                                                                 rasterizationOptions.TextRenderingHint = Aspose.Imaging.TextRenderingHint.AntiAlias;

                                                                                                                 // Reduce the image size 10 times, i.e. the output size will be 10% of the original size.
                                                                                                                 rasterizationOptions.ScaleX = 0.1f;
                                                                                                                 rasterizationOptions.ScaleY = 0.1f;

                                                                                                                 Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
                                                                                                                 saveOptions.VectorRasterizationOptions = rasterizationOptions;

                                                                                                                 // Save to a PNG file
                                                                                                                 svgImage.Save(dir + "test.output.png", saveOptions);
                                                                                                             }