Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Plot2DLinePainter.cs
1using SkiaSharp;
2
4{
9 {
19 public void DrawGraph(SKCanvas Canvas, SKPoint[] Points, object[] Parameters, SKPoint[] PrevPoints, object[] PrevParameters,
21 {
22 SKPaint Pen = null;
23 SKPath Path = null;
24 bool First = true;
25
26 try
27 {
28 Pen = Graph.ToPen(Parameters[0], Parameters[1]);
29 Path = new SKPath();
30
31 foreach (SKPoint Point in Points)
32 {
33 if (First)
34 {
35 First = false;
36 Path.MoveTo(Point);
37 }
38 else
39 Path.LineTo(Point);
40 }
41
42 Canvas.DrawPath(Path, Pen);
43 }
44 finally
45 {
46 Pen?.Dispose();
47 Path?.Dispose();
48 }
49 }
50
51 }
52}
Contains information about the current drawing area.
Definition: DrawingArea.cs:12
void DrawGraph(SKCanvas Canvas, SKPoint[] Points, object[] Parameters, SKPoint[] PrevPoints, object[] PrevParameters, DrawingArea DrawingArea)
Draws the graph on a canvas.
Base class for graphs.
Definition: Graph.cs:79
static SKPaint ToPen(object Object, object Size)
Converts an object to a pen value.
Definition: Graph.cs:769
Interface for 2D graph drawing functions.
Definition: IPainter2D.cs:10