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

Represents a light-weight rendering action. More...

Inheritance diagram for VectSharp.Canvas.SKRenderAction:

Public Types

enum  ActionTypes
 Types of rendering actions. More...
 

Public Member Functions

void InvalidateHitTestPath ()
 
void InvalidateVisual ()
 
void InvalidateZIndex ()
 
void InvalidateAll ()
 
void Dispose ()
 

Static Public Member Functions

static SKRenderAction PathAction (SKPath path, SKPaint paint, string tag=null)
 Creates a new SKRenderAction representing a path. More...
 
static SKRenderAction ClipAction (SKPath clippingPath, string tag=null)
 Creates a new SKRenderAction representing a clipping action. More...
 
static SKRenderAction TextAction (string text, float x, float y, SKFont font, SKPaint paint, string tag=null)
 Creates a new SKRenderAction representing text. More...
 
static SKRenderAction ImageAction (string imageId, SKRect sourceRect, SKRect destinationRect, string tag=null)
 Creates a new SKRenderAction representing an image. More...
 
static SKRenderAction TransformAction (SKMatrix transform, string tag=null)
 Creates a new SKRenderAction representing a transform. More...
 
static SKRenderAction SaveAction (string tag=null)
 Creates a new SKRenderAction that saves the current graphics state. More...
 
static SKRenderAction RestoreAction (string tag=null)
 Creates a new SKRenderAction that saves the current graphics state. More...
 
static SKRenderAction DrawFilteredGraphicsAction (SKRenderContext graphics, IFilter filter, string tag=null)
 Create a new SKRenderAction that draws some graphics with a filter. More...
 

Properties

bool Disposed [get]
 Returns a boolean value indicating whether the current instance has been disposed. More...
 
ActionTypes ActionType [get]
 Type of the rendering action. More...
 
SKPath Path [get, set]
 Path that needs to be rendered (null if the action type is not ActionTypes.Path). If you change this, you probably want to call this object's InvalidateHitTestPath method. More...
 
string Text [get, set]
 Text that needs to be rendered (null if the action type is not ActionTypes.Text). If you change this, you probably want to call this object's InvalidateHitTestPath method. More...
 
SKFont Font [get, set]
 The font that will be used to render the text (null if the action type is not ActionTypes.Text). If you change this, you probably want to call this object's InvalidateHitTestPath method. More...
 
float TextX [get, set]
 The X coordainate at which the text will be drawn (null if the action type is not ActionTypes.Text). If you change this, you probably want to call this object's InvalidateHitTestPath method. More...
 
float TextY [get, set]
 The Y coordainate at which the text will be drawn (null if the action type is not ActionTypes.Text). If you change this, you probably want to call this object's InvalidateHitTestPath method. More...
 
SKPaint Paint [get, set]
 Paint used to render the text or path (null if the action type is neither ActionTypes.Text nor ActionTypes.Path). If you change this, you probably want to call this object's InvalidateHitTestPath method. More...
 
string ImageId [get, set]
 Univocal identifier of the image that needs to be drawn. More...
 
SKRect? ImageSource [get, set]
 The source rectangle of the image (null if the action type is not ActionTypes.RasterImage). If you change this, you probably want to call this object's InvalidateVisual method. More...
 
SKRect? ImageDestination [get, set]
 The destination rectangle of the image (null if the action type is not ActionTypes.RasterImage). If you change this, you probably want to call this object's InvalidateHitTestPath method. More...
 
SKMatrix? Transform = null [get, set]
 The transformation matrix that will be applied to the current coordinate system (null if the action type is not ActionTypes.Transform). If you change this, you probably want to call this object's InvalidateVisual method. More...
 
string Tag [get]
 A tag to access the SKRenderAction. More...
 
uint ZIndex = 0 [get, set]
 The Z-index of the rendering action (an action with a higher Z-index will always appear above an action with a lower Z-index). The more different values there are for the Z-index, the slower the rendering, so keep use of this property to a minimum. If you change this, you probably want to call this object's InvalidateZIndex method. More...
 
SKRenderContext Graphics = null [get, set]
 The graphics that will be drawn with the specified Filter. If you change this, you probably want to call this object's InvalidateVisual method. More...
 
IFilter Filter [get, set]
 The filter with which the Graphics is drawn. If you change this, you probably want to call this object's InvalidateVisual method. More...
 
object Payload [get, set]
 An arbitrary object associated with the RenderAction. More...
 
Avalonia.Controls.Canvas Parent [get]
 The container of this SKRenderAction. More...
 

Events

EventHandler< Avalonia.Input.PointerEventArgs > PointerEntered
 Raised when the pointer enters the area covered by the SKRenderAction. More...
 
EventHandler< Avalonia.Input.PointerEventArgs > PointerExited
 Raised when the pointer leaves the area covered by the SKRenderAction. More...
 
EventHandler< Avalonia.Input.PointerPressedEventArgs > PointerPressed
 Raised when the pointer is pressed while over the area covered by the SKRenderAction. More...
 
EventHandler< Avalonia.Input.PointerReleasedEventArgs > PointerReleased
 Raised when the pointer is released after a PointerPressed event. More...
 

Detailed Description

Represents a light-weight rendering action.

Definition at line 30 of file SKRenderContext.cs.

Member Enumeration Documentation

◆ ActionTypes

Types of rendering actions.

Definition at line 42 of file SKRenderContext.cs.

Member Function Documentation

◆ ClipAction()

static SKRenderAction VectSharp.Canvas.SKRenderAction.ClipAction ( SKPath  clippingPath,
string  tag = null 
)
static

Creates a new SKRenderAction representing a clipping action.

Parameters
clippingPathThe path to be used for clipping.
tagA tag to access the SKRenderAction.
Returns
A new SKRenderAction representing a clipping action.

Definition at line 345 of file SKRenderContext.cs.

◆ Dispose()

void VectSharp.Canvas.SKRenderAction.Dispose ( )

Definition at line 494 of file SKRenderContext.cs.

◆ DrawFilteredGraphicsAction()

static SKRenderAction VectSharp.Canvas.SKRenderAction.DrawFilteredGraphicsAction ( SKRenderContext  graphics,
IFilter  filter,
string  tag = null 
)
static

Create a new SKRenderAction that draws some graphics with a filter.

Returns
A new SKRenderAction that draws some graphics with a filter.

Definition at line 464 of file SKRenderContext.cs.

◆ ImageAction()

static SKRenderAction VectSharp.Canvas.SKRenderAction.ImageAction ( string  imageId,
SKRect  sourceRect,
SKRect  destinationRect,
string  tag = null 
)
static

Creates a new SKRenderAction representing an image.

Parameters
imageIdThe univocal identifier of the image to draw.
sourceRectThe source rectangle of the image.
destinationRectThe destination rectangle of the image.
tagA tag to access the SKRenderAction. If this is null this SKRenderAction is not visible in the hit test.
Returns
A new SKRenderAction representing an image.

Definition at line 397 of file SKRenderContext.cs.

◆ InvalidateAll()

void VectSharp.Canvas.SKRenderAction.InvalidateAll ( )

This methods signals to the Parent that the Z-index, shape and visual properties (e.g. the colour) of this object have changed and triggers a redraw.

If you make changes to more than one SKRenderAction contained in the same Canvas, you only need to invalidate the last one.

This method should only be called after the output has been fully initialized.

Definition at line 303 of file SKRenderContext.cs.

◆ InvalidateHitTestPath()

void VectSharp.Canvas.SKRenderAction.InvalidateHitTestPath ( )

Signals to this object that its shape has changed and a new path needs to be computed for the purpose of hit-testing. Also signals to the Parent that the visual properties of this object have changed and triggers a redraw.

This method should be called whenever the "shape" of the object represented by the SKRenderAction changes. If only the visual properties of this object have changed (e.g. the colour), call the InvalidateVisual method instead.

If you make changes to more than one SKRenderAction contained in the same SKMultiLayerRenderCanvas, you only need to invalidate the last one.

This method should only be called after the output has been fully initialized.

Definition at line 232 of file SKRenderContext.cs.

◆ InvalidateVisual()

void VectSharp.Canvas.SKRenderAction.InvalidateVisual ( )

This methods signals to the Parent that the visual properties (e.g. the colour) of this object have changed and triggers a redraw.

If the "shape" of the object has changed as well, call the InvalidateHitTestPath method instead. If the Z-index of the object has changed, call the InvalidateZIndex method instead. If both the "shape" and the Z-index of the object have changed, call the InvalidateAll method.

If you make changes to more than one SKRenderAction contained in the same Canvas, you only need to invalidate the last one.

This method should only be called after the output has been fully initialized.

Definition at line 282 of file SKRenderContext.cs.

◆ InvalidateZIndex()

void VectSharp.Canvas.SKRenderAction.InvalidateZIndex ( )

This methods signals to the Parent that the Z-index and visual properties (e.g. the colour) of this object have changed and triggers a redraw.

If the "shape" of the object has changed as well, call the InvalidateAll method instead.

If you make changes to more than one SKRenderAction contained in the same Canvas, you only need to invalidate the last one.

This method should only be called after the output has been fully initialized.

Definition at line 293 of file SKRenderContext.cs.

◆ PathAction()

static SKRenderAction VectSharp.Canvas.SKRenderAction.PathAction ( SKPath  path,
SKPaint  paint,
string  tag = null 
)
static

Creates a new SKRenderAction representing a path.

Parameters
pathThe geometry to be rendered.
paintThe paint used to fill or stroke the path.
tagA tag to access the SKRenderAction. If this is null this SKRenderAction is not visible in the hit test.
Returns
A new SKRenderAction representing a path.

Definition at line 321 of file SKRenderContext.cs.

◆ RestoreAction()

static SKRenderAction VectSharp.Canvas.SKRenderAction.RestoreAction ( string  tag = null)
static

Creates a new SKRenderAction that saves the current graphics state.

Parameters
tagA tag to access the SKRenderAction.
Returns
A new SKRenderAction that restores the last saved graphics state.

Definition at line 451 of file SKRenderContext.cs.

◆ SaveAction()

static SKRenderAction VectSharp.Canvas.SKRenderAction.SaveAction ( string  tag = null)
static

Creates a new SKRenderAction that saves the current graphics state.

Parameters
tagA tag to access the SKRenderAction.
Returns
A new SKRenderAction that saves the current graphics state.

Definition at line 437 of file SKRenderContext.cs.

◆ TextAction()

static SKRenderAction VectSharp.Canvas.SKRenderAction.TextAction ( string  text,
float  x,
float  y,
SKFont  font,
SKPaint  paint,
string  tag = null 
)
static

Creates a new SKRenderAction representing text.

Parameters
textThe text to be rendered.
xThe X coordinate at which the text will be drawn.
yThe Y coordinate at which the text will be drawn.
fontThe font to be used to render the text.
paintThe paint to be used to fill or stroke the text.
tagA tag to access the SKRenderAction. If this is null this SKRenderAction is not visible in the hit test.
Returns
A new SKRenderAction representing text.

Definition at line 365 of file SKRenderContext.cs.

◆ TransformAction()

static SKRenderAction VectSharp.Canvas.SKRenderAction.TransformAction ( SKMatrix  transform,
string  tag = null 
)
static

Creates a new SKRenderAction representing a transform.

Parameters
transformThe transform to apply.
tagA tag to access the SKRenderAction.
Returns
A new SKRenderAction representing a transform.

Definition at line 422 of file SKRenderContext.cs.

Property Documentation

◆ ActionType

ActionTypes VectSharp.Canvas.SKRenderAction.ActionType
get

Type of the rendering action.

Definition at line 88 of file SKRenderContext.cs.

◆ Disposed

bool VectSharp.Canvas.SKRenderAction.Disposed
get

Returns a boolean value indicating whether the current instance has been disposed.

Definition at line 35 of file SKRenderContext.cs.

◆ Filter

IFilter VectSharp.Canvas.SKRenderAction.Filter
getset

The filter with which the Graphics is drawn. If you change this, you probably want to call this object's InvalidateVisual method.

Definition at line 163 of file SKRenderContext.cs.

◆ Font

SKFont VectSharp.Canvas.SKRenderAction.Font
getset

The font that will be used to render the text (null if the action type is not ActionTypes.Text). If you change this, you probably want to call this object's InvalidateHitTestPath method.

Definition at line 106 of file SKRenderContext.cs.

◆ Graphics

SKRenderContext VectSharp.Canvas.SKRenderAction.Graphics = null
getset

The graphics that will be drawn with the specified Filter. If you change this, you probably want to call this object's InvalidateVisual method.

Definition at line 158 of file SKRenderContext.cs.

◆ ImageDestination

SKRect? VectSharp.Canvas.SKRenderAction.ImageDestination
getset

The destination rectangle of the image (null if the action type is not ActionTypes.RasterImage). If you change this, you probably want to call this object's InvalidateHitTestPath method.

Definition at line 136 of file SKRenderContext.cs.

◆ ImageId

string VectSharp.Canvas.SKRenderAction.ImageId
getset

Univocal identifier of the image that needs to be drawn.

Definition at line 126 of file SKRenderContext.cs.

◆ ImageSource

SKRect? VectSharp.Canvas.SKRenderAction.ImageSource
getset

The source rectangle of the image (null if the action type is not ActionTypes.RasterImage). If you change this, you probably want to call this object's InvalidateVisual method.

Definition at line 131 of file SKRenderContext.cs.

◆ Paint

SKPaint VectSharp.Canvas.SKRenderAction.Paint
getset

Paint used to render the text or path (null if the action type is neither ActionTypes.Text nor ActionTypes.Path). If you change this, you probably want to call this object's InvalidateHitTestPath method.

Definition at line 121 of file SKRenderContext.cs.

◆ Parent

Avalonia.Controls.Canvas VectSharp.Canvas.SKRenderAction.Parent
get

The container of this SKRenderAction.

Definition at line 175 of file SKRenderContext.cs.

◆ Path

SKPath VectSharp.Canvas.SKRenderAction.Path
getset

Path that needs to be rendered (null if the action type is not ActionTypes.Path). If you change this, you probably want to call this object's InvalidateHitTestPath method.

Definition at line 93 of file SKRenderContext.cs.

◆ Payload

object VectSharp.Canvas.SKRenderAction.Payload
getset

An arbitrary object associated with the RenderAction.

Definition at line 168 of file SKRenderContext.cs.

◆ Tag

string VectSharp.Canvas.SKRenderAction.Tag
get

A tag to access the SKRenderAction.

Definition at line 146 of file SKRenderContext.cs.

◆ Text

string VectSharp.Canvas.SKRenderAction.Text
getset

Text that needs to be rendered (null if the action type is not ActionTypes.Text). If you change this, you probably want to call this object's InvalidateHitTestPath method.

Definition at line 101 of file SKRenderContext.cs.

◆ TextX

float VectSharp.Canvas.SKRenderAction.TextX
getset

The X coordainate at which the text will be drawn (null if the action type is not ActionTypes.Text). If you change this, you probably want to call this object's InvalidateHitTestPath method.

Definition at line 111 of file SKRenderContext.cs.

◆ TextY

float VectSharp.Canvas.SKRenderAction.TextY
getset

The Y coordainate at which the text will be drawn (null if the action type is not ActionTypes.Text). If you change this, you probably want to call this object's InvalidateHitTestPath method.

Definition at line 116 of file SKRenderContext.cs.

◆ Transform

SKMatrix? VectSharp.Canvas.SKRenderAction.Transform = null
getset

The transformation matrix that will be applied to the current coordinate system (null if the action type is not ActionTypes.Transform). If you change this, you probably want to call this object's InvalidateVisual method.

Definition at line 141 of file SKRenderContext.cs.

◆ ZIndex

uint VectSharp.Canvas.SKRenderAction.ZIndex = 0
getset

The Z-index of the rendering action (an action with a higher Z-index will always appear above an action with a lower Z-index). The more different values there are for the Z-index, the slower the rendering, so keep use of this property to a minimum. If you change this, you probably want to call this object's InvalidateZIndex method.

Definition at line 153 of file SKRenderContext.cs.

Event Documentation

◆ PointerEntered

EventHandler<Avalonia.Input.PointerEventArgs> VectSharp.Canvas.SKRenderAction.PointerEntered

Raised when the pointer enters the area covered by the SKRenderAction.

Definition at line 186 of file SKRenderContext.cs.

◆ PointerExited

EventHandler<Avalonia.Input.PointerEventArgs> VectSharp.Canvas.SKRenderAction.PointerExited

Raised when the pointer leaves the area covered by the SKRenderAction.

Definition at line 191 of file SKRenderContext.cs.

◆ PointerPressed

EventHandler<Avalonia.Input.PointerPressedEventArgs> VectSharp.Canvas.SKRenderAction.PointerPressed

Raised when the pointer is pressed while over the area covered by the SKRenderAction.

Definition at line 196 of file SKRenderContext.cs.

◆ PointerReleased

EventHandler<Avalonia.Input.PointerReleasedEventArgs> VectSharp.Canvas.SKRenderAction.PointerReleased

Raised when the pointer is released after a PointerPressed event.

Definition at line 201 of file SKRenderContext.cs.


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