public async void Ellipse(RGBA color, Point center, float width, float height, bool fill = true, bool border = true, float thickness = 5) { // http://www.williammalone.com/briefs/how-to-draw-ellipse-html5-canvas/ var hex = ColorCache(color); if (border) { await Surface.SetLineWidthAsync(thickness < 1f? 1f : thickness); await Surface.SetStrokeStyleAsync(hex); } else { await Surface.SetStrokeStyleAsync(hex); } await Surface.BeginPathAsync(); { await Surface.MoveToAsync(center.X, center.Y - (height / 2f)); await Surface.BezierCurveToAsync( center.X + (width * 0.67f), center.Y - (height / 2f), // C1 center.X + (width * 0.67f), center.Y + (height / 2f), // C2 center.X, center.Y + (height / 2f)); // A2 await Surface.BezierCurveToAsync( center.X - (width * 0.67f), center.Y + (height / 2f), // C3 center.X - (width * 0.67f), center.Y - (height / 2f), // C4 center.X, center.Y - (height / 2f)); // A1 if (fill) { await Surface.SetFillStyleAsync(hex); await Surface.FillAsync(); } else { await Surface.StrokeAsync(); } } await Surface.ClosePathAsync(); }