VectSharp  2.2.1
A light library for C# vector graphics
VectSharp.Raster.ImageSharp.ImageSharpContextInterpreter Class Reference

Contains methods to render a Page to an Image. More...

Classes

class  UnknownFormatException
 The exception that is raised when the output file format is not specified and the file name does not have an extension corresponding to a known file format. More...
 

Static Public Member Functions

static Image< SixLabors.ImageSharp.PixelFormats.Rgba32 > SaveAsImage (this Page page, double scale=1)
 Render the page to an Image object. More...
 
static void SaveAsImage (this Page page, Stream imageStream, OutputFormats outputFormat, double scale=1)
 Render the page to an image stream. More...
 
static void SaveAsImage (this Page page, string fileName, OutputFormats? outputFormat=null, double scale=1)
 Render the page to an image file. More...
 
static DisposableIntPtr SaveAsRawBytes (this Page pag, out int width, out int height, out int totalSize, double scale=1)
 Return the page to raw pixel data, in 32bpp RGBA format. More...
 
static byte[] SaveAsRawBytes (this Page pag, out int width, out int height, double scale=1)
 Return the page to raw pixel data, in 32bpp RGBA format. More...
 
static RasterImage Rasterise (this Graphics graphics, Rectangle region, double scale, bool interpolate)
 Rasterise a region of a Graphics object. More...
 

Detailed Description

Contains methods to render a Page to an Image.

Definition at line 1001 of file ImageSharpContext.cs.

Member Function Documentation

◆ Rasterise()

static RasterImage VectSharp.Raster.ImageSharp.ImageSharpContextInterpreter.Rasterise ( this Graphics  graphics,
Rectangle  region,
double  scale,
bool  interpolate 
)
static

Rasterise a region of a Graphics object.

Parameters
graphicsThe Graphics object that will be rasterised.
regionThe region of the graphics that will be rasterised.
scaleThe scale at which the image will be rendered.
interpolateWhether the resulting image should be interpolated or not when it is drawn on another Graphics surface.
Returns
A RasterImage containing the rasterised graphics.

Definition at line 1233 of file ImageSharpContext.cs.

◆ SaveAsImage() [1/3]

static Image<SixLabors.ImageSharp.PixelFormats.Rgba32> VectSharp.Raster.ImageSharp.ImageSharpContextInterpreter.SaveAsImage ( this Page  page,
double  scale = 1 
)
static

Render the page to an Image object.

Parameters
pageThe Page to render.
scaleThe scale to be used when rasterising the page. This will determine the width and height of the Image.
Returns
An Image containing the rasterised page.

Definition at line 1009 of file ImageSharpContext.cs.

◆ SaveAsImage() [2/3]

static void VectSharp.Raster.ImageSharp.ImageSharpContextInterpreter.SaveAsImage ( this Page  page,
Stream  imageStream,
OutputFormats  outputFormat,
double  scale = 1 
)
static

Render the page to an image stream.

Parameters
pageThe Page to render.
imageStreamThe Stream on which the image data will be written.
outputFormatThe format of the image that will be created.
scaleThe scale to be used when rasterising the page. This will determine the width and height of the image.

Definition at line 1025 of file ImageSharpContext.cs.

◆ SaveAsImage() [3/3]

static void VectSharp.Raster.ImageSharp.ImageSharpContextInterpreter.SaveAsImage ( this Page  page,
string  fileName,
OutputFormats outputFormat = null,
double  scale = 1 
)
static

Render the page to an image file.

Parameters
pageThe Page to render.
fileNameThe path of the file where the image will be saved.
outputFormatThe format of the image that will be created. If this is null (the default), the format is desumed from the extension of the file.
scaleThe scale to be used when rasterising the page. This will determine the width and height of the image.

Definition at line 1083 of file ImageSharpContext.cs.

◆ SaveAsRawBytes() [1/2]

static byte [] VectSharp.Raster.ImageSharp.ImageSharpContextInterpreter.SaveAsRawBytes ( this Page  pag,
out int  width,
out int  height,
double  scale = 1 
)
static

Return the page to raw pixel data, in 32bpp RGBA format.

Parameters
pagThe Page to render.
scaleThe scale to be used when rasterising the page. This will determine the width and height of the image.
widthThe width of the rendered image.
heightThe height of the rendered image.
Returns
A byte array containing the raw pixel data.

Definition at line 1196 of file ImageSharpContext.cs.

◆ SaveAsRawBytes() [2/2]

static DisposableIntPtr VectSharp.Raster.ImageSharp.ImageSharpContextInterpreter.SaveAsRawBytes ( this Page  pag,
out int  width,
out int  height,
out int  totalSize,
double  scale = 1 
)
static

Return the page to raw pixel data, in 32bpp RGBA format.

Parameters
pagThe Page to render.
scaleThe scale to be used when rasterising the page. This will determine the width and height of the image.
widthThe width of the rendered image.
heightThe height of the rendered image.
totalSizeThe size in bytes of the raw pixel data.
Returns
A DisposableIntPtr containing a pointer to the raw pixel data, stored in unmanaged memory. Dispose this object to release the unmanaged memory.

Definition at line 1153 of file ImageSharpContext.cs.


The documentation for this class was generated from the following file: