Contains methods to render a page to a PNG image.
More...
|
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...
|
|
static DisposableIntPtr | SaveAsRawBytes (this Page pag, out int width, out int height, out int totalSize, double scale=1) |
| Render the page to raw pixel data, in 32bpp RGBA format. More...
|
|
static void | SaveAsAnimatedPNG (this Animation animation, Stream imageStream, double scale=1, double frameRate=60, double durationScaling=1, AnimatedPNG.InterframeCompression interframeCompression=AnimatedPNG.InterframeCompression.First) |
| Saves the animation to a stream in animated PNG format. More...
|
|
static void | SaveAsAnimatedPNG (this Animation animation, string fileName, double scale=1, double frameRate=60, double durationScaling=1, AnimatedPNG.InterframeCompression interframeCompression=AnimatedPNG.InterframeCompression.First) |
| Saves the animation to an animated PNG file. More...
|
|
static void | SaveAsJPEG (this Page page, string fileName, double scale=1, int quality=90) |
| Render the page to a JPEG file. More...
|
|
Contains methods to render a page to a PNG image.
Definition at line 30 of file Raster.cs.
◆ Rasterise()
Rasterise a region of a Graphics object.
- Parameters
-
graphics | The Graphics object that will be rasterised. |
region | The region of the graphics that will be rasterised. |
scale | The scale at which the image will be rendered. |
interpolate | Whether 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 91 of file Raster.cs.
◆ SaveAsAnimatedPNG() [1/2]
static void VectSharp.Raster.Raster.SaveAsAnimatedPNG |
( |
this Animation |
animation, |
|
|
Stream |
imageStream, |
|
|
double |
scale = 1 , |
|
|
double |
frameRate = 60 , |
|
|
double |
durationScaling = 1 , |
|
|
AnimatedPNG.InterframeCompression |
interframeCompression = AnimatedPNG.InterframeCompression.First |
|
) |
| |
|
static |
Saves the animation to a stream in animated PNG format.
- Parameters
-
animation | The animation to export. |
imageStream | The stream on which the animated PNG will be written. |
scale | The scale at which the animation will be rendered. |
frameRate | The target frame rate of the animation, in frames-per-second (fps). This is capped by the animated PNG specification at 90 fps. |
durationScaling | A scaling factor that will be applied to all durations in the animation. Values greater than 1 slow down the animation, values smaller than 1 accelerate it. Note that this does not affect the frame rate of the animation. |
interframeCompression | The kind of compression that will be used to reduce file size. Note that if the animation has a transparent background, no compression can be performed, and the value of this parameter is ignored. |
Definition at line 184 of file Raster.cs.
◆ SaveAsAnimatedPNG() [2/2]
static void VectSharp.Raster.Raster.SaveAsAnimatedPNG |
( |
this Animation |
animation, |
|
|
string |
fileName, |
|
|
double |
scale = 1 , |
|
|
double |
frameRate = 60 , |
|
|
double |
durationScaling = 1 , |
|
|
AnimatedPNG.InterframeCompression |
interframeCompression = AnimatedPNG.InterframeCompression.First |
|
) |
| |
|
static |
Saves the animation to an animated PNG file.
- Parameters
-
animation | The animation to export. |
fileName | The output file to create. |
scale | The scale at which the animation will be rendered. |
frameRate | The target frame rate of the animation, in frames-per-second (fps). This is capped by the animated PNG specification at 90 fps. |
durationScaling | A scaling factor that will be applied to all durations in the animation. Values greater than 1 slow down the animation, values smaller than 1 accelerate it. Note that this does not affect the frame rate of the animation. |
interframeCompression | The kind of compression that will be used to reduce file size. Note that if the animation has a transparent background, no compression can be performed, and the value of this parameter is ignored. |
Definition at line 267 of file Raster.cs.
◆ SaveAsJPEG()
static void VectSharp.Raster.Raster.SaveAsJPEG |
( |
this Page |
page, |
|
|
string |
fileName, |
|
|
double |
scale = 1 , |
|
|
int |
quality = 90 |
|
) |
| |
|
static |
Render the page to a JPEG file.
- Parameters
-
page | The Page to render. |
fileName | The full path to the file to save. If it exists, it will be overwritten. |
scale | The scale to be used when rasterising the page. This will determine the width and height of the image file. |
quality | The quality of the JPEG output (ranging from 0 to 100). |
Definition at line 283 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
-
page | The Page to render. |
stream | The stream to which the PNG data will be written. |
scale | The scale to be used when rasterising the page. This will determine the width and height of the image file. |
Definition at line 64 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
-
page | The Page to render. |
fileName | The full path to the file to save. If it exists, it will be overwritten. |
scale | The scale to be used when rasterising the page. This will determine the width and height of the image file. |
Definition at line 39 of file Raster.cs.
◆ SaveAsRawBytes()
static DisposableIntPtr VectSharp.Raster.Raster.SaveAsRawBytes |
( |
this Page |
pag, |
|
|
out int |
width, |
|
|
out int |
height, |
|
|
out int |
totalSize, |
|
|
double |
scale = 1 |
|
) |
| |
|
static |
Render the page to raw pixel data, in 32bpp RGBA format.
- Parameters
-
pag | The Page to render. |
scale | The scale to be used when rasterising the page. This will determine the width and height of the image. |
width | The width of the rendered image. |
height | The height of the rendered image. |
totalSize | The 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 143 of file Raster.cs.
The documentation for this class was generated from the following file: