private void DrawEllipse(SKCanvas canvas, EllipseDrawingFigure ellipse) { _paint.Color = new SKColor(0, 0, 0); canvas.DrawOval(ellipse.Rectangle.Margin(2), _paint); _paint.Color = new SKColor(255, 255, 255); canvas.DrawOval(ellipse.Rectangle, _paint); _paint.Color = new SKColor(0, 0, 0); _paint.TextAlign = SKTextAlign.Center; _paint.TextSize = GridWidth; DrawText(canvas, ellipse.Center, ellipse.Text); }
private EllipseDrawingFigure[] CreateEllipses(SKPoint pt1, SKPoint pt2) { var left = Math.Min(pt1.X, pt2.X); var top = Math.Min(pt1.Y, pt2.Y); var right = Math.Max(pt1.X, pt2.X); var bottom = Math.Max(pt1.Y, pt2.Y); var ellipses = new List <EllipseDrawingFigure>(); for (var x = left; x <= right; x += EllipseWidth) { for (var y = top; y <= bottom; y += EllipseWidth) { var ellipse = new EllipseDrawingFigure { Center = new SKPoint(x, y), Width = EllipseWidth, Text = (_completedEllipses.Count + ellipses.Count + 1).ToString(), }; ellipses.Add(ellipse); } } return(ellipses.ToArray()); }