Class SvgRasterizationOptions

Class SvgRasterizationOptions

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

The SVG rasterization options.

public class SvgRasterizationOptions : VectorRasterizationOptions, ICloneable
{
    private bool _antialias;
    private double _dpiX;
    private double _dpiY;
    private float _emSize;
    private Color _backgroundColor;
    private RasterizationMode _rasterizationMode;
    private bool _saveAlphaChannel;
    private bool _drawTextAsPaths;
    private bool _ignoreStrokeOverprint;
    private bool _usePatternForFillOpacity;
    public SvgRasterizationOptions()
    {
    }
    public override bool Antialias
    {
        get { return _antialias; }
        set { _antialias = value; }
    }
    public double DpiX
    {
        get { return _dpiX; }
        set { _dpiX = value; }
    }
    public double DpiY
    {
        get { return _dpiY; }
        set { _dpiY = value; }
    }
    public float EmSize
    {
        get { return _emSize; }
        set { _emSize = value; }
    }
    public Color BackgroundColor
    {
        get { return _backgroundColor; }
        set { _backgroundColor = value; }
    }
    public RasterizationMode RasterizationMode
    {
        get { return _rasterizationMode; }
        set { _rasterizationMode = value; }
    }
    public bool SaveAlphaChannel
    {
        get { return _saveAlphaChannel; }
        set { _saveAlphaChannel = value; }
    }
    public bool DrawTextAsPaths
    {
        get { return _drawTextAsPaths; }
        set { _drawTextAsPaths = value; }
    }
    public bool IgnoreStrokeOverprint
    {
        get { return _ignoreStrokeOverprint; }
        set { _ignoreStrokeOverprint = value; }
    }
    public bool UsePatternForFillOpacity
    {
        get { return _usePatternForFillOpacity; }
        set { _usePatternForFillOpacity = value; }
    }
    object ICloneable.Clone()
    {
    }
}

Inheritance

object VectorRasterizationOptions SvgRasterizationOptions

Implements

ICloneable

Inherited Members

VectorRasterizationOptions.Clone() , 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 , 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.

string dir = "c:\\temp\\";
   using (Aspose.Imaging.FileFormats.Svg.SvgImage svgImage = (Aspose.Imaging.FileFormats.Svg.SvgImage)Aspose.Imaging.Image.Load(dir + "test.svg"))
   {
       Aspose.Imaging.ImageOptions.SvgRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions();
       rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.Gray;
       rasterizationOptions.PageSize = svgImage.Size;
       rasterizationOptions.SmoothingMode = Aspose.Imaging.SmoothingMode.AntiAlias;
       rasterizationOptions.TextRenderingHint = Aspose.Imaging.TextRenderingHint.AntiAlias;
       rasterizationOptions.ScaleX = 0.1f;
       rasterizationOptions.ScaleY = 0.1f;
       Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
       saveOptions.VectorRasterizationOptions = rasterizationOptions;
       svgImage.Save(dir + "test.output.png", saveOptions);
   }

ScaleY

Gets or sets the scale y.

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.

string dir = "c:\\temp\\";
   using (Aspose.Imaging.FileFormats.Svg.SvgImage svgImage = Aspose.Imaging.Image.Load(dir + "test.svg"))
   {
       var rasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions();
       rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.Gray;
       rasterizationOptions.PageSize = svgImage.Size;
       rasterizationOptions.SmoothingMode = Aspose.Imaging.SmoothingMode.AntiAlias;
       rasterizationOptions.TextRenderingHint = Aspose.Imaging.TextRenderingHint.AntiAlias;
       rasterizationOptions.ScaleX = 0.1f;
       rasterizationOptions.ScaleY = 0.1f;
       var saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
       saveOptions.VectorRasterizationOptions = rasterizationOptions;
       svgImage.Save(dir + "test.output.png", saveOptions);
   }

Methods

CopyTo(VectorRasterizationOptions)

Copies this instance to vectorRasterizationOptions'.

public override void CopyTo(
      VectorRasterizationOptions vectorRasterizationOptions)
   {
   }

Parameters

vectorRasterizationOptions VectorRasterizationOptions

The vector rasterization options.

 English