Skip to content

Instantly share code, notes, and snippets.

@hachikiina
hachikiina / createpolygon.cs
Created May 17, 2020 01:13
system.drawing to skiasharp
public string DrawRegularPolygonSK(int vertexCount, float radius, SocketCommandContext context, [Optional] int rndNum)
{
string imagesPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "data", "images");
if (!Directory.Exists(imagesPath))
Directory.CreateDirectory(imagesPath);
using (SKBitmap bmp = new SKBitmap(1024, 1024))
using (SKPaint outerPaint = new SKPaint())
using (SKPaint innerPaint = new SKPaint())
using (SKPaint textPaint = new SKPaint())