1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| // Image size (pixels)
int WIDTH = 1920;
int radius =60;
Random random = new Random();
SKBitmap bmp = new(1280, WIDTH);
SKCanvas canvas = new(bmp);
canvas.Clear(SKColor.Parse("#fff"));
SKPaint paint = new()
{
Color = SKColors.White.WithAlpha(100),
IsAntialias = true ,
StrokeWidth = 1,
ColorF = SKColor.Parse("#000000"),
Style = SKPaintStyle.Stroke
};
var ls = GetCenter(10,7,radius);
for(var n=3;n<=26;n++)
{
float X = ls[n-3].Y;
float Y = ls[n-3].X;
paint.ColorF =listOfColor[random.Next(0,listOfColor.Count)];
foreach(var i in GetAllLinePoints(n:n,x:X,y:Y, radius:radius))
{
canvas.DrawLine(i.Item1,i.Item2,paint);
canvas.DrawText($"{n} Points",X-20,Y+80,paint);
}
canvas.DrawCircle(X,Y,60,paint);
}
bmp.Display()
|