Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Polygon2DPainter.cs
1using System;
2using SkiaSharp;
3
5{
10 {
20 public void DrawGraph(SKCanvas Canvas, SKPoint[] Points, object[] Parameters, SKPoint[] PrevPoints, object[] PrevParameters,
22 {
23 SKColor Color = Graph.ToColor(Parameters[0]);
24 SKPaint Brush = new SKPaint
25 {
26 IsAntialias = true,
27 Style = SKPaintStyle.Fill,
28 Color = Color
29 };
30
31 SKPath Path = new SKPath();
32 bool First = true;
33
34 foreach (SKPoint P in Points)
35 {
36 if (First)
37 {
38 First = false;
39 Path.MoveTo(P);
40 }
41 else
42 Path.LineTo(P);
43 }
44
45 Path.Close();
46
47 Canvas.DrawPath(Path, Brush);
48
49 Brush.Dispose();
50 Path.Dispose();
51 }
52 }
53}
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:88
static SKColor ToColor(object Object)
Converts an object to a color.
Definition: Graph.cs:844
Interface for 2D graph drawing functions.
Definition: IPainter2D.cs:10