private static void DrawMonthRing(SKImageInfo info, SKCanvas canvas, IMonthModel month)
        {
            var monthRing = ElementDrawer.CreateRing(info, canvas, Utility.GetWidthValueFromPercentage(info, (float)21), new Color(255, 255, 255), false);

            monthRing.FillColor = new Color(255, 255, 0, 0);
            var monthPegPoints = ElementDrawer.CreatePegPoints(info, canvas, monthRing, 13, ((Math.PI * 2) / 13) / 2);

            var monthLabelRing = ElementDrawer.CreateRing(info, canvas, Utility.GetWidthValueFromPercentage(info, (float)19.5), new Color(255, 255, 255), false);

            var   monthLabelPoints = ElementDrawer.CreatePegPoints(info, canvas, monthLabelRing, 13, ((Math.PI * 2) / 13) / 2);
            float rotation         = 74;

            monthPegPoints[month.Get() - 1].FillColor = new Color(255, 0, 0);
            for (int i = 0; i <= monthPegPoints.Length - 1; i++)
            {
                SKPaint txtPaint1 = new SKPaint()
                {
                    Color       = Color.FromRgb(255, 255, 255).ToSKColor(),
                    Style       = SKPaintStyle.Fill,
                    StrokeWidth = 1,
                    TextSize    = Utility.GetWidthValueFromPercentage(info, 2.2f)
                };
                SKPaint txtPaint2 = new SKPaint()
                {
                    Color       = Color.FromRgb(0, 0, 0).ToSKColor(),
                    Style       = SKPaintStyle.Stroke,
                    StrokeWidth = 2,
                    TextSize    = Utility.GetWidthValueFromPercentage(info, 2.2f)
                };

                canvas.DrawCircle(monthPegPoints[i].x, monthPegPoints[i].y, monthPegPoints[i].Radius, GetPointPainter(monthPegPoints[i]));
                SKRect textbounds = new SKRect();
                var    labelText  = month.GetMonthName(i + 1);
                txtPaint1.MeasureText(labelText, ref textbounds);
                canvas.Save();
                canvas.RotateDegrees(rotation, monthLabelPoints[i].x, monthLabelPoints[i].y);
                canvas.DrawText(labelText, monthLabelPoints[i].x, monthLabelPoints[i].y + (textbounds.Height / 2), txtPaint1);
                canvas.DrawText(labelText, monthLabelPoints[i].x, monthLabelPoints[i].y + (textbounds.Height / 2), txtPaint2);
                canvas.Restore();
                rotation = rotation - 27.69f;
            }
        }
Beispiel #2
0
        private string GetMetonicDate()
        {
            string date = _dayModel.Get() + " " + _monthModel.GetMonthName() + ", year " + _metonicYearModel.GetMetonicYear();

            return(date);
        }