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 FilterQuality = SKFilterQuality.High,
27 IsAntialias = true,
28 Style = SKPaintStyle.Fill,
29 Color = Color
30 };
31
32 SKPath Path = new SKPath();
33 bool First = true;
34
35 foreach (SKPoint P in Points)
36 {
37 if (First)
38 {
39 First = false;
40 Path.MoveTo(P);
41 }
42 else
43 Path.LineTo(P);
44 }
45
46 Path.Close();
47
48 Canvas.DrawPath(Path, Brush);
49
50 Brush.Dispose();
51 Path.Dispose();
52 }
53 }
54}
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 SKColor ToColor(object Object)
Converts an object to a color.
Definition: Graph.cs:828
Interface for 2D graph drawing functions.
Definition: IPainter2D.cs:10