SvgImage

SvgImage(string)

Initialise une nouvelle instance duSvgImage classe.

public SvgImage(string path)
ParamètreTaperLa description
pathStringLe chemin à partir duquel charger l’image et initialiser les données de pixel et de palette avec.

Exceptions

exceptioncondition
ArgumentNullExceptionchemin est nul.

Voir également


SvgImage(Stream)

Initialise une nouvelle instance duSvgImage classe.

public SvgImage(Stream stream)
ParamètreTaperLa description
streamStreamLe flux à partir duquel charger l’image et initialiser les données de pixel et de palette avec.

Exceptions

exceptioncondition
ArgumentNullExceptionflux est nul.

Exemples

Cet exemple montre comment charger une image SVG à partir d’un flux de fichiers et la pixelliser au format PNG.

[C#]

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

// Charge une image SVG à partir d'un flux de fichier.
using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "test.svg"))
using (Aspose.Imaging.FileFormats.Svg.SvgImage svgImage = new Aspose.Imaging.FileFormats.Svg.SvgImage(stream))
{
    // Afin de pixelliser SVG, nous devons spécifier les options de pixellisation.
    Aspose.Imaging.ImageOptions.SvgRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.SvgRasterizationOptions();
    Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
    saveOptions.VectorRasterizationOptions = rasterizationOptions;

    svgImage.Save(dir + "test.output.png", saveOptions);
}

Voir également


SvgImage(int, int)

Initialise une nouvelle instance duSvgImage classe.

public SvgImage(int width, int height)
ParamètreTaperLa description
widthInt32La largeur de l’image.
heightInt32La hauteur de l’image.

Voir également


SvgImage(SvgOptions, int, int)

Initialise une nouvelle instance duSvgImage classe.

public SvgImage(SvgOptions svgOptions, int width, int height)
ParamètreTaperLa description
svgOptionsSvgOptionsLes options SVG.
widthInt32Largeur de l’image.
heightInt32Hauteur de l’image.

Voir également