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

Contains methods to render a Page to an Avalonia.Controls.Canvas using the SkiaSharp renderer. More...

Static Public Member Functions

static SKMultiLayerRenderCanvas PaintToSKCanvas (this Document document, double? width=null, double? height=null, Colour? background=null, AvaloniaContextInterpreter.TextOptions textOption=AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Document to an Avalonia.Controls.Canvas using the SkiaSharp renderer. Each page corresponds to a layer in the image. More...
 
static SKMultiLayerRenderCanvas PaintToSKCanvas (this Document document, Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>> taggedActions, bool removeTaggedActionsAfterExecution=true, double? width=null, double? height=null, Colour? background=null, AvaloniaContextInterpreter.TextOptions textOption=AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Document to an Avalonia.Controls.Canvas using the SkiaSharp renderer. Each page corresponds to a layer in the image. More...
 
static SKMultiLayerRenderCanvas PaintToSKCanvas (this Document document, Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>> taggedActions, Dictionary< string,(SKBitmap, bool)> images, bool removeTaggedActionsAfterExecution=true, double? width=null, double? height=null, Colour? background=null, AvaloniaContextInterpreter.TextOptions textOption=AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Document to an Avalonia.Controls.Canvas using the SkiaSharp renderer. Each page corresponds to a layer in the image. More...
 
static SKMultiLayerRenderCanvas PaintToSKCanvas (this Page page, AvaloniaContextInterpreter.TextOptions textOption=AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to an Avalonia.Controls.Canvas using the SkiaSharp renderer. More...
 
static SKMultiLayerRenderCanvas PaintToSKCanvas (this Page page, Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>> taggedActions, bool removeTaggedActionsAfterExecution=true, AvaloniaContextInterpreter.TextOptions textOption=AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to an Avalonia.Controls.Canvas using the SkiaSharpRenderer. More...
 
static SKMultiLayerRenderCanvas PaintToSKCanvas (this Page page, Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>> taggedActions, Dictionary< string,(SKBitmap, bool)> images, bool removeTaggedActionsAfterExecution=true, AvaloniaContextInterpreter.TextOptions textOption=AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to an Avalonia.Controls.Canvas using the SkiaSharpRenderer. More...
 
static SKRenderContext CopyToSKRenderContext (this Page page, AvaloniaContextInterpreter.TextOptions textOption=AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to a SKRenderContext. This can be drawn using the SkiaSharpRenderer by adding it to a SKMultiLayerRenderCanvas. More...
 
static SKRenderContext CopyToSKRenderContext (this Page page, Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>> taggedActions, bool removeTaggedActionsAfterExecution=true, AvaloniaContextInterpreter.TextOptions textOption=AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to a SKRenderContext. This can be drawn using the SkiaSharpRenderer by adding it to a SKMultiLayerRenderCanvas. More...
 
static SKRenderContext CopyToSKRenderContext (this Page page, Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>> taggedActions, Dictionary< string,(SKBitmap, bool)> images, bool removeTaggedActionsAfterExecution=true, AvaloniaContextInterpreter.TextOptions textOption=AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to a SKRenderContext. This can be drawn using the SkiaSharpRenderer by adding it to a SKMultiLayerRenderCanvas. 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 Avalonia.Controls.Canvas using the SkiaSharp renderer.

Definition at line 1534 of file SKRenderContext.cs.

Member Function Documentation

◆ CopyToSKRenderContext() [1/3]

static SKRenderContext VectSharp.Canvas.SKRenderContextInterpreter.CopyToSKRenderContext ( this Page  page,
AvaloniaContextInterpreter.TextOptions  textOption = AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to a SKRenderContext. This can be drawn using the SkiaSharpRenderer by adding it to a SKMultiLayerRenderCanvas.

Parameters
pageThe Page to render.
textOptionDefines whether text items should be converted into paths when drawing.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.
Returns
A SKRenderContext containing the rendered graphics objects.

Definition at line 1655 of file SKRenderContext.cs.

◆ CopyToSKRenderContext() [2/3]

static SKRenderContext VectSharp.Canvas.SKRenderContextInterpreter.CopyToSKRenderContext ( this Page  page,
Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>>  taggedActions,
bool  removeTaggedActionsAfterExecution = true,
AvaloniaContextInterpreter.TextOptions  textOption = AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to a SKRenderContext. This can be drawn using the SkiaSharpRenderer by adding it to a SKMultiLayerRenderCanvas.

Parameters
pageThe Page to render.
taggedActionsA Dictionary containing the actions that will be performed on items with the corresponding tag. These should be functions that accept one parameter of type SKRenderAction and return an IEnumerable<SKRenderAction> of the render actions that will actually be added to the plot.
removeTaggedActionsAfterExecutionWhether the actions should be removed from taggedActions after their execution. Set to false if the same action should be performed on multiple items with the same tag.
textOptionDefines whether text items should be converted into paths when drawing.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.
Returns
A SKRenderContext containing the rendered graphics objects.

Definition at line 1670 of file SKRenderContext.cs.

◆ CopyToSKRenderContext() [3/3]

static SKRenderContext VectSharp.Canvas.SKRenderContextInterpreter.CopyToSKRenderContext ( this Page  page,
Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>>  taggedActions,
Dictionary< string,(SKBitmap, bool)>  images,
bool  removeTaggedActionsAfterExecution = true,
AvaloniaContextInterpreter.TextOptions  textOption = AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to a SKRenderContext. This can be drawn using the SkiaSharpRenderer by adding it to a SKMultiLayerRenderCanvas.

Parameters
pageThe Page to render.
taggedActionsA Dictionary containing the actions that will be performed on items with the corresponding tag. These should be functions that accept one parameter of type SKRenderAction and return an IEnumerable<SKRenderAction> of the render actions that will actually be added to the plot.
imagesA dictionary that associates to each raster image path (or data URL) the image rendered as a SKBitmap and a boolean value indicating whether it should be drawn as "pixelated" or not. This will be populated automatically as the page is rendered. If you are rendering multiple Pages (or you are rendering the same page multiple times), it will be beneficial to keep a reference to this dictionary and pass it again on further rendering requests; otherwise, you can just pass an empty dictionary.
removeTaggedActionsAfterExecutionWhether the actions should be removed from taggedActions after their execution. Set to false if the same action should be performed on multiple items with the same tag.
textOptionDefines whether text items should be converted into paths when drawing.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.
Returns
A SKRenderContext containing the rendered graphics objects.

Definition at line 1687 of file SKRenderContext.cs.

◆ PaintToSKCanvas() [1/6]

static SKMultiLayerRenderCanvas VectSharp.Canvas.SKRenderContextInterpreter.PaintToSKCanvas ( this Document  document,
Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>>  taggedActions,
bool  removeTaggedActionsAfterExecution = true,
double?  width = null,
double?  height = null,
Colour background = null,
AvaloniaContextInterpreter.TextOptions  textOption = AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Document to an Avalonia.Controls.Canvas using the SkiaSharp renderer. Each page corresponds to a layer in the image.

Parameters
documentThe Document to render.
taggedActionsA Dictionary containing the actions that will be performed on items with the corresponding tag. These should be functions that accept one parameter of type SKRenderAction and return an IEnumerable<SKRenderAction> of the render actions that will actually be added to the plot.
removeTaggedActionsAfterExecutionWhether the actions should be removed from taggedActions after their execution. Set to false if the same action should be performed on multiple items with the same tag.
widthThe width of the document. If this is null, the width of the largest page is used.
heightThe height of the document. If this is null, the height of the largest page is used.
backgroundThe background colour of the document. If this is null, a transparent background is used.
textOptionDefines whether text items should be converted into paths when drawing.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.
Returns
An Avalonia.Controls.Canvas containing the rendered graphics objects.

Definition at line 1579 of file SKRenderContext.cs.

◆ PaintToSKCanvas() [2/6]

static SKMultiLayerRenderCanvas VectSharp.Canvas.SKRenderContextInterpreter.PaintToSKCanvas ( this Document  document,
Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>>  taggedActions,
Dictionary< string,(SKBitmap, bool)>  images,
bool  removeTaggedActionsAfterExecution = true,
double?  width = null,
double?  height = null,
Colour background = null,
AvaloniaContextInterpreter.TextOptions  textOption = AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Document to an Avalonia.Controls.Canvas using the SkiaSharp renderer. Each page corresponds to a layer in the image.

Parameters
documentThe Document to render.
taggedActionsA Dictionary containing the actions that will be performed on items with the corresponding tag. These should be functions that accept one parameter of type SKRenderAction and return an IEnumerable<SKRenderAction> of the render actions that will actually be added to the plot.
imagesA dictionary that associates to each raster image path (or data URL) the image rendered as a SKBitmap and a boolean value indicating whether it should be drawn as "pixelated" or not. This will be populated automatically as the page is rendered. If you are rendering multiple Pages (or you are rendering the same page multiple times), it will be beneficial to keep a reference to this dictionary and pass it again on further rendering requests; otherwise, you can just pass an empty dictionary.
removeTaggedActionsAfterExecutionWhether the actions should be removed from taggedActions after their execution. Set to false if the same action should be performed on multiple items with the same tag.
widthThe width of the document. If this is null, the width of the largest page is used.
heightThe height of the document. If this is null, the height of the largest page is used.
backgroundThe background colour of the document. If this is null, a transparent background is used.
textOptionDefines whether text items should be converted into paths when drawing.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.
Returns
An Avalonia.Controls.Canvas containing the rendered graphics objects.

Definition at line 1599 of file SKRenderContext.cs.

◆ PaintToSKCanvas() [3/6]

static SKMultiLayerRenderCanvas VectSharp.Canvas.SKRenderContextInterpreter.PaintToSKCanvas ( this Document  document,
double?  width = null,
double?  height = null,
Colour background = null,
AvaloniaContextInterpreter.TextOptions  textOption = AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Document to an Avalonia.Controls.Canvas using the SkiaSharp renderer. Each page corresponds to a layer in the image.

Parameters
documentThe Document to render.
widthThe width of the document. If this is null, the width of the largest page is used.
heightThe height of the document. If this is null, the height of the largest page is used.
backgroundThe background colour of the document. If this is null, a transparent background is used.
textOptionDefines whether text items should be converted into paths when drawing.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.
Returns
An Avalonia.Controls.Canvas containing the rendered graphics objects.

Definition at line 1561 of file SKRenderContext.cs.

◆ PaintToSKCanvas() [4/6]

static SKMultiLayerRenderCanvas VectSharp.Canvas.SKRenderContextInterpreter.PaintToSKCanvas ( this Page  page,
AvaloniaContextInterpreter.TextOptions  textOption = AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to an Avalonia.Controls.Canvas using the SkiaSharp renderer.

Parameters
pageThe Page to render.
textOptionDefines whether text items should be converted into paths when drawing.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.
Returns
An Avalonia.Controls.Canvas containing the rendered graphics objects.

Definition at line 1611 of file SKRenderContext.cs.

◆ PaintToSKCanvas() [5/6]

static SKMultiLayerRenderCanvas VectSharp.Canvas.SKRenderContextInterpreter.PaintToSKCanvas ( this Page  page,
Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>>  taggedActions,
bool  removeTaggedActionsAfterExecution = true,
AvaloniaContextInterpreter.TextOptions  textOption = AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to an Avalonia.Controls.Canvas using the SkiaSharpRenderer.

Parameters
pageThe Page to render.
taggedActionsA Dictionary containing the actions that will be performed on items with the corresponding tag. These should be functions that accept one parameter of type SKRenderAction and return an IEnumerable<SKRenderAction> of the render actions that will actually be added to the plot.
removeTaggedActionsAfterExecutionWhether the actions should be removed from taggedActions after their execution. Set to false if the same action should be performed on multiple items with the same tag.
textOptionDefines whether text items should be converted into paths when drawing.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.
Returns
An Avalonia.Controls.Canvas containing the rendered graphics objects.

Definition at line 1626 of file SKRenderContext.cs.

◆ PaintToSKCanvas() [6/6]

static SKMultiLayerRenderCanvas VectSharp.Canvas.SKRenderContextInterpreter.PaintToSKCanvas ( this Page  page,
Dictionary< string, Func< SKRenderAction, IEnumerable< SKRenderAction >>>  taggedActions,
Dictionary< string,(SKBitmap, bool)>  images,
bool  removeTaggedActionsAfterExecution = true,
AvaloniaContextInterpreter.TextOptions  textOption = AvaloniaContextInterpreter.TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to an Avalonia.Controls.Canvas using the SkiaSharpRenderer.

Parameters
pageThe Page to render.
taggedActionsA Dictionary containing the actions that will be performed on items with the corresponding tag. These should be functions that accept one parameter of type SKRenderAction and return an IEnumerable<SKRenderAction> of the render actions that will actually be added to the plot.
imagesA dictionary that associates to each raster image path (or data URL) the image rendered as a SKBitmap and a boolean value indicating whether it should be drawn as "pixelated" or not. This will be populated automatically as the page is rendered. If you are rendering multiple Pages (or you are rendering the same page multiple times), it will be beneficial to keep a reference to this dictionary and pass it again on further rendering requests; otherwise, you can just pass an empty dictionary.
removeTaggedActionsAfterExecutionWhether the actions should be removed from taggedActions after their execution. Set to false if the same action should be performed on multiple items with the same tag.
textOptionDefines whether text items should be converted into paths when drawing.
filterOptionDefines how and whether image filters should be rasterised when rendering the image.
Returns
An Avalonia.Controls.Canvas containing the rendered graphics objects.

Definition at line 1643 of file SKRenderContext.cs.

◆ Rasterise()

static RasterImage VectSharp.Canvas.SKRenderContextInterpreter.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 1712 of file SKRenderContext.cs.


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