Class VectorRasterizationOptions

Class VectorRasterizationOptions

Названий на: Aspose.Imaging.ImageOptions Асамблея: Aspose.Imaging.dll (25.4.0)

Вибір варіантів векторної растеризації.Будь ласка, зверніть увагу на те, що Aspose.Imaging.ImageOptions.VectorRasterizationОпціони більше не походять з W L17.від Aspose.Imaging 24.12 версії.

[JsonObject(MemberSerialization.OptIn)]
public class VectorRasterizationOptions : ImageOptionsBase, IDisposable, IHasXmpData, IHasMetadata, ICloneable

Inheritance

object DisposableObject ImageOptionsBase VectorRasterizationOptions

Derived

CdrRasterizationOptions , CmxRasterizationOptions , EpsRasterizationOptions , MetafileRasterizationOptions , OdRasterizationOptions , SvgRasterizationOptions

Implements

IDisposable , IHasXmpData , IHasMetadata , ICloneable

Нападні члени

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

VectorRasterizationOptions()

public VectorRasterizationOptions()

Properties

BackgroundColor

Приймати або встановити колір фону.

[JsonProperty]
public Color BackgroundColor { get; set; }

вартість нерухомості

Color

Examples

Цей приклад показує, як завантажити зображення WMF з файлу і конвертувати його в SVG за допомогою WmfRasterizationOptions.

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

                                                                                                                      // Using Aspose.Imaging.Image.Load is a unified way to load all types of images including WMF.
                                                                                                                      using (Aspose.Imaging.FileFormats.Wmf.WmfImage wmfImage = (Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir + "test.wmf"))
                                                                                                                      {
                                                                                                                          Aspose.Imaging.ImageOptions.SvgOptions saveOptions = new Aspose.Imaging.ImageOptions.SvgOptions();

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

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

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

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

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

                                                                                                                          saveOptions.VectorRasterizationOptions = rasterizationOptions;

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

Цей приклад показує, як завантажити зображення EMF з файлу і конвертувати його в SVG за допомогою 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);
                                                                                                                      }

Цей приклад показує, як завантажити зображення SVG з файлу і растерзувати його в PNG за допомогою різних варіантів.

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

кордони

Знайдіть або встановити кордон X.

[JsonProperty]
public float BorderX { get; set; }

вартість нерухомості

float

кордони

Знайти або встановити кордон Y.

[JsonProperty]
public float BorderY { get; set; }

вартість нерухомості

float

CenterDrawing

Приймає або встановлює вартість, яка вказує на те, чи центр малює.

[JsonProperty]
public bool CenterDrawing { get; set; }

вартість нерухомості

bool

DrawColor

Приймати або встановити передній колір.

[JsonProperty]
public Color DrawColor { get; set; }

вартість нерухомості

Color

PageHeight

Знайти або встановити висоту сторінки.Якщо вартість 0, збережеться відсоток аспекту зображення джерела.

public float PageHeight { get; set; }

вартість нерухомості

float

PageSize

Знайти або встановити розмір сторінки.Якщо одна з розмірів Aspose.Imaging.SizeF є 0, збережеться співвідношення аспекту зображення джерела.

public SizeF PageSize { get; set; }

вартість нерухомості

SizeF

Examples

Цей приклад показує, як завантажити зображення WMF з файлу і конвертувати його в SVG за допомогою WmfRasterizationOptions.

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

                                                                                                                      // Using Aspose.Imaging.Image.Load is a unified way to load all types of images including WMF.
                                                                                                                      using (Aspose.Imaging.FileFormats.Wmf.WmfImage wmfImage = (Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir + "test.wmf"))
                                                                                                                      {
                                                                                                                          Aspose.Imaging.ImageOptions.SvgOptions saveOptions = new Aspose.Imaging.ImageOptions.SvgOptions();

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

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

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

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

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

                                                                                                                          saveOptions.VectorRasterizationOptions = rasterizationOptions;

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

Цей приклад показує, як завантажити зображення EMF з файлу і конвертувати його в SVG за допомогою 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);
                                                                                                                      }

Цей приклад показує, як завантажити зображення SVG з файлу і растерзувати його в PNG за допомогою різних варіантів.

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

PageWidth

Знайти або встановити ширину сторінки.Якщо вартість 0, збережеться відсоток аспекту зображення джерела.

public float PageWidth { get; set; }

вартість нерухомості

float

Positioning

Приймати або встановити позицію.

[JsonProperty]
public PositioningTypes Positioning { get; set; }

вартість нерухомості

PositioningTypes

Examples

Наступний приклад показує, як встановити обмеження пам’яті при завантаженні зображення CMX. Меморіальний обсяг - максимальний дозволений розмір (в мегабайтах) для всіх внутрішніх буферів.

string dir = "c:\\aspose.imaging\\issues\\net\\3419\\";

                                                                                                                                                                                // Setting a memory limit of 10 megabytes for a target loaded image.
                                                                                                                                                                                using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "example.cmx", new Aspose.Imaging.LoadOptions() { BufferSizeHint = 10 }))
                                                                                                                                                                                {
                                                                                                                                                                                    image.Save(dir + "output.png",
                                                                                                                                                                                        new Aspose.Imaging.ImageOptions.PngOptions()
                                                                                                                                                                                        {
                                                                                                                                                                                            VectorRasterizationOptions =
                                                                                                                                                                                                    new Aspose.Imaging.ImageOptions.CmxRasterizationOptions
                                                                                                                                                                                                    {
                                                                                                                                                                                                        TextRenderingHint = Aspose.Imaging.TextRenderingHint.SingleBitPerPixel,
                                                                                                                                                                                                        SmoothingMode = Aspose.Imaging.SmoothingMode.AntiAlias,
                                                                                                                                                                                                        Positioning = Aspose.Imaging.ImageOptions.PositioningTypes.DefinedByDocument
                                                                                                                                                                                                    }
                                                                                                                                                                                        });
                                                                                                                                                                                }

Наступний приклад показує, як експортувати всі сторінки документа CDR в PDF.

string dir = "c:\\aspose.imaging\\issues\\net\\3635\\testdata\\3570";
                                                                                      string inputCdrFileName = System.IO.Path.Combine(dir, "tiger.cdr");
                                                                                      string outputPdfFileName = System.IO.Path.Combine(dir, "tiger.cdr.pdf");

                                                                                      using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputCdrFileName))
                                                                                      {
                                                                                          Aspose.Imaging.ImageOptions.PdfOptions pdfOptions = new Aspose.Imaging.ImageOptions.PdfOptions();
                                                                                          Aspose.Imaging.ImageOptions.CdrRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.CdrRasterizationOptions
                                                                                          {
                                                                                              TextRenderingHint = Aspose.Imaging.TextRenderingHint.SingleBitPerPixel,
                                                                                              SmoothingMode = Aspose.Imaging.SmoothingMode.None,
                                                                                              Positioning = Aspose.Imaging.ImageOptions.PositioningTypes.DefinedByDocument
                                                                                          };

                                                                                          pdfOptions.VectorRasterizationOptions = rasterizationOptions;
                                                                                          image.Save(outputPdfFileName, pdfOptions);
                                                                                      }

ReplaceTextMapping

Приймати або встановити текст замінити папку.

[JsonProperty]
public Dictionary<string, string=""> ReplaceTextMapping { get; set; }

вартість нерухомості

Dictionary • < string , string >

SmoothingMode

Приймати або встановити режим розтягування.

[JsonProperty]
public SmoothingMode SmoothingMode { get; set; }

вартість нерухомості

SmoothingMode

Examples

Цей приклад показує, як завантажити зображення SVG з файлу і растерзувати його в PNG за допомогою різних варіантів.

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

TextRenderingHint

Приймає або встановлює текст, що дає інструкцію.

[JsonProperty]
public TextRenderingHint TextRenderingHint { get; set; }

вартість нерухомості

TextRenderingHint

Examples

Цей приклад показує, як завантажити зображення SVG з файлу і растерзувати його в PNG за допомогою різних варіантів.

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)

Копіюйте цю інстанцію в vectorRasterizationOptions'.

public virtual void CopyTo(VectorRasterizationOptions vectorRasterizationOptions)

Parameters

vectorRasterizationOptions VectorRasterizationOptions

Вибір варіантів векторної растеризації.</string,>

 Українська