Class SvgRasterizationOptions

Class SvgRasterizationOptions

Nombre del espacio: Aspose.Imaging.ImageOptions Asamblea: Aspose.Imaging.dll (25.4.0)

Las opciones de rasterización de SVG.

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

Inheritance

object DisposableObject ImageOptionsBase VectorRasterizationOptions SvgRasterizationOptions

Implements

IDisposable ,y, IHasXmpData ,y, IHasMetadata ,y, ICloneable

Miembros heredados

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

Constructors

SvgRasterizationOptions()

public SvgRasterizationOptions()

Properties

Escalera

Obtenga o establece la escala x.

public float ScaleX { get; set; }

Valor de la propiedad

float

Examples

Este ejemplo muestra cómo cargar una imagen SVG de un archivo y rasterizarla a PNG utilizando varias opciones.

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);
                                                                                                                 }

Escalera

Obtenga o coloca la escala y.

public float ScaleY { get; set; }

Valor de la propiedad

float

Examples

Este ejemplo muestra cómo cargar una imagen SVG de un archivo y rasterizarla a PNG utilizando varias opciones.

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);
                                                                                                                 }

Methods

CopyTo(VectorRasterizationOptions)

Copia esta instancia a vectorRasterizationOptions'.

public override void CopyTo(VectorRasterizationOptions vectorRasterizationOptions)

Parameters

vectorRasterizationOptions VectorRasterizationOptions

Las opciones de rasterización vector.

 Español