VectSharp 2.6.1
A light library for C# vector graphics
Loading...
Searching...
No Matches
VectSharp.Canvas.AvaloniaContextInterpreter Class Reference

Contains methods to render a Page to an Avalonia.Controls.Canvas. More...

Public Types

enum  TextOptions
 Defines whether text items should be converted into paths when drawing. More...
 

Static Public Member Functions

static Avalonia.Controls.Canvas PaintToCanvas (this Page page, TextOptions textOption=TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to an Avalonia.Controls.Canvas. More...
 
static Avalonia.Controls.Control PaintToCanvas (this Page page, bool graphicsAsControls, TextOptions textOption=TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to an Avalonia.Controls.Control. More...
 
static Avalonia.Controls.Control PaintToCanvas (this Page page, bool graphicsAsControls, Dictionary< string, Delegate > taggedActions, bool removeTaggedActionsAfterExecution=true, TextOptions textOption=TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to an Avalonia.Controls.Control. More...
 
static Avalonia.Controls.Canvas PaintToCanvas (this Page page, Dictionary< string, Delegate > taggedActions, bool removeTaggedActionsAfterExecution=true, TextOptions textOption=TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render a Page to an Avalonia.Controls.Control. More...
 
static AnimatedCanvas PaintToAnimatedCanvas (this Animation animation, double frameRate=60, double durationScaling=1, TextOptions textOption=TextOptions.ConvertIfNecessary, FilterOption filterOption=default)
 Render an Animation to an Avalonia.Controls.Control. More...
 

Detailed Description

Contains methods to render a Page to an Avalonia.Controls.Canvas.

Definition at line 2604 of file AvaloniaContext.cs.

Member Enumeration Documentation

◆ TextOptions

Defines whether text items should be converted into paths when drawing.

Definition at line 2609 of file AvaloniaContext.cs.

Member Function Documentation

◆ PaintToAnimatedCanvas()

static AnimatedCanvas VectSharp.Canvas.AvaloniaContextInterpreter.PaintToAnimatedCanvas ( this Animation  animation,
double  frameRate = 60,
double  durationScaling = 1,
TextOptions  textOption = TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render an Animation to an Avalonia.Controls.Control.

Parameters
animationThe Animation to render.
frameRateThe target frame rate of the animation, in frames-per-second (fps).
durationScalingA 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.
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.Control containing the rendered animation.

Definition at line 2727 of file AvaloniaContext.cs.

◆ PaintToCanvas() [1/4]

static Avalonia.Controls.Control VectSharp.Canvas.AvaloniaContextInterpreter.PaintToCanvas ( this Page  page,
bool  graphicsAsControls,
Dictionary< string, Delegate >  taggedActions,
bool  removeTaggedActionsAfterExecution = true,
TextOptions  textOption = TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to an Avalonia.Controls.Control.

Parameters
pageThe Page to render.
graphicsAsControlsIf this is true, each graphics object (e.g. paths, text...) is rendered as a separate Avalonia.Controls.Control. Otherwise, they are directly rendered onto the drawing context (which is faster, but does not allow interactivity).
taggedActionsA Dictionary<String, Delegate> containing the Actions that will be performed on items with the corresponding tag. If graphicsAsControls is true, the delegates should be voids that accept one parameter of type TextBlock or Path (depending on the tagged item), otherwise, they should accept one parameter of type RenderAction and return an IEnumerable<RenderAction> of the actions that will actually be performed.
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.Control containing the rendered graphics objects.

Definition at line 2679 of file AvaloniaContext.cs.

◆ PaintToCanvas() [2/4]

static Avalonia.Controls.Control VectSharp.Canvas.AvaloniaContextInterpreter.PaintToCanvas ( this Page  page,
bool  graphicsAsControls,
TextOptions  textOption = TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to an Avalonia.Controls.Control.

Parameters
pageThe Page to render.
graphicsAsControlsIf this is true, each graphics object (e.g. paths, text...) is rendered as a separate Avalonia.Controls.Control. Otherwise, they are directly rendered onto the drawing context (which is faster, but does not allow interactivity).
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.Control containing the rendered graphics objects.

Definition at line 2652 of file AvaloniaContext.cs.

◆ PaintToCanvas() [3/4]

static Avalonia.Controls.Canvas VectSharp.Canvas.AvaloniaContextInterpreter.PaintToCanvas ( this Page  page,
Dictionary< string, Delegate >  taggedActions,
bool  removeTaggedActionsAfterExecution = true,
TextOptions  textOption = TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to an Avalonia.Controls.Control.

Parameters
pageThe Page to render.
taggedActionsA Dictionary<String, Delegate> containing the Actions that will be performed on items with the corresponding tag. The delegates should accept one parameter of type TextBlock or Path (depending on the tagged item).
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.Control containing the rendered graphics objects.

Definition at line 2705 of file AvaloniaContext.cs.

◆ PaintToCanvas() [4/4]

static Avalonia.Controls.Canvas VectSharp.Canvas.AvaloniaContextInterpreter.PaintToCanvas ( this Page  page,
TextOptions  textOption = TextOptions.ConvertIfNecessary,
FilterOption  filterOption = default 
)
static

Render a Page to an Avalonia.Controls.Canvas.

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 2634 of file AvaloniaContext.cs.


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