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

Contains methods to render a page to a PNG image. More...

Static Public Member Functions

static void SaveAsPNG (this Page page, string fileName, double scale=1)
 Render the page to a PNG file. More...
 
static void SaveAsPNG (this Page page, Stream stream, double scale=1)
 Render the page to a PNG stream. 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 a PNG image.

Definition at line 29 of file Raster.cs.

Member Function Documentation

◆ Rasterise()

static RasterImage VectSharp.Raster.Raster.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 90 of file Raster.cs.

◆ SaveAsPNG() [1/2]

static void VectSharp.Raster.Raster.SaveAsPNG ( this Page  page,
Stream  stream,
double  scale = 1 
)
static

Render the page to a PNG stream.

Parameters
pageThe Page to render.
streamThe stream to which the PNG data will be written.
scaleThe scale to be used when rasterising the page. This will determine the width and height of the image file.

Definition at line 63 of file Raster.cs.

◆ SaveAsPNG() [2/2]

static void VectSharp.Raster.Raster.SaveAsPNG ( this Page  page,
string  fileName,
double  scale = 1 
)
static

Render the page to a PNG file.

Parameters
pageThe Page to render.
fileNameThe full path to the file to save. If it exists, it will be overwritten.
scaleThe scale to be used when rasterising the page. This will determine the width and height of the image file.

Definition at line 38 of file Raster.cs.


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