Class SvgRasterizationOptions
Il nome: Aspose.Imaging.ImageOptions Assemblea: Aspose.Imaging.dll (25.5.0)
Le opzioni di rasterizzazione SVG.
public class SvgRasterizationOptions : VectorRasterizationOptions, ICloneableInheritance
object ← VectorRasterizationOptions ← SvgRasterizationOptions
Implements
I membri ereditari
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
Ottenere o impostare la scala x.
public float ScaleX { get; set; }Valore di proprietà
Examples
Questo esempio mostra come caricare un’immagine SVG da un file e rasterizzarla a PNG utilizzando varie opzioni.
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);
                                                                                                                 }Scala
Ottieni o impostate la scala Y.
public float ScaleY { get; set; }Valore di proprietà
Examples
Questo esempio mostra come caricare un’immagine SVG da un file e rasterizzarla a PNG utilizzando varie opzioni.
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 questa instanza a vectorRasterizationOptions'.
public override void CopyTo(VectorRasterizationOptions vectorRasterizationOptions)Parameters
vectorRasterizationOptions VectorRasterizationOptions
Opzioni di rasterizzazione vectoriale.