Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CanvasState.cs
1
using
System
;
2
using
System.Collections.Generic
;
3
using
System.Text;
4
using
SkiaSharp
;
5
6
namespace
Waher.Script.Graphs.Canvas2D.Operations
7
{
11
public
class
CanvasState
12
{
13
private
SKColor fgColor;
14
private
SKColor bgColor;
15
private
SKPaint pen =
null
;
16
private
SKPaint brush =
null
;
17
private
float
width = 1;
18
22
public
SKColor
FgColor
23
{
24
get
=> this.fgColor;
25
set
26
{
27
this.fgColor = value;
28
29
this.pen?.Dispose();
30
this.pen =
null
;
31
32
this.brush?.Dispose();
33
this.brush =
null
;
34
}
35
}
36
40
public
float
Width
41
{
42
get
=> this.width;
43
set
44
{
45
this.width = value;
46
47
this.pen?.Dispose();
48
this.pen =
null
;
49
}
50
}
51
55
public
SKColor
BgColor
56
{
57
get
=> this.bgColor;
58
set
=> this.bgColor = value;
59
}
60
64
public
float
X
65
{
66
get
;
67
set
;
68
}
69
73
public
float
Y
74
{
75
get
;
76
set
;
77
}
78
82
public
SKPaint
Pen
83
{
84
get
85
{
86
if
(this.pen is
null
)
87
{
88
this.pen =
new
SKPaint()
89
{
90
IsAntialias =
true
,
91
Style = SKPaintStyle.Stroke,
92
Color = this.fgColor,
93
StrokeWidth = this.width
94
};
95
}
96
97
return
this.pen;
98
}
99
}
100
104
public
SKPaint
Brush
105
{
106
get
107
{
108
if
(this.brush is
null
)
109
{
110
this.brush =
new
SKPaint()
111
{
112
IsAntialias =
true
,
113
Style = SKPaintStyle.Fill,
114
Color = this.fgColor
115
};
116
}
117
118
return
this.brush;
119
}
120
}
121
}
122
}
Waher.Script.Graphs.Canvas2D.Operations.CanvasState
Current drawing state in a canvas graph.
Definition:
CanvasState.cs:12
Waher.Script.Graphs.Canvas2D.Operations.CanvasState.BgColor
SKColor BgColor
Background color
Definition:
CanvasState.cs:56
Waher.Script.Graphs.Canvas2D.Operations.CanvasState.FgColor
SKColor FgColor
Foreground color
Definition:
CanvasState.cs:23
Waher.Script.Graphs.Canvas2D.Operations.CanvasState.Brush
SKPaint Brush
Current brush
Definition:
CanvasState.cs:105
Waher.Script.Graphs.Canvas2D.Operations.CanvasState.Y
float Y
Current Y-coordinate.
Definition:
CanvasState.cs:74
Waher.Script.Graphs.Canvas2D.Operations.CanvasState.X
float X
Current X-coordinate.
Definition:
CanvasState.cs:65
Waher.Script.Graphs.Canvas2D.Operations.CanvasState.Width
float Width
Pen width
Definition:
CanvasState.cs:41
Waher.Script.Graphs.Canvas2D.Operations.CanvasState.Pen
SKPaint Pen
Current pen
Definition:
CanvasState.cs:83
SkiaSharp
Definition:
ImplTypes.g.cs:1087
System.Collections.Generic
Definition:
ImplTypes.g.cs:4970
System
Definition:
Adapters.g.cs:58
Waher.Script.Graphs.Canvas2D.Operations
Definition:
CanvasOperation.cs:7
IoTGateway
Script
Waher.Script.Graphs
Canvas2D
Operations
CanvasState.cs
Generated by
1.9.5