Example #1
0
        public void DrawImage(SKCanvas canvas, SKRect rect_Card)
        {
            var firstHeight = MainGraphics !.GetFontSize(40);
            var firstWidth  = MainGraphics.GetFontSize(16);
            var firstRect   = SKRect.Create(MainGraphics.Location.X, MainGraphics.Location.Y, rect_Card.Width, firstHeight);

            DrawValue(canvas, firstRect);
            var otherLocation = new SKPoint(MainGraphics.Location.X, firstRect.Bottom);
            var pointList     = ImageHelpers.GetPoints(EnumShapes.Balls, HowManyBalls, otherLocation, false, firstWidth);
            var testSize      = new SKSize(firstWidth, firstWidth);

            foreach (var thisPoint in pointList)
            {
                var testRect = SKRect.Create(thisPoint, testSize);
                canvas.DrawOval(testRect, _redPaint);
                canvas.DrawOval(testRect, _blackBorder);
            }
            pointList = ImageHelpers.GetPoints(EnumShapes.Cones, HowManyCones, otherLocation, false, firstWidth);
            foreach (var thisPoint in pointList)
            {
                var testRect = SKRect.Create(thisPoint, testSize);
                ImageHelpers.DrawCone(canvas, testRect);
            }
            pointList = ImageHelpers.GetPoints(EnumShapes.Cubes, HowManyCubes, otherLocation, false, firstWidth);
            foreach (var thisPoint in pointList)
            {
                var testRect = SKRect.Create(thisPoint, testSize);
                ImageHelpers.DrawCube(canvas, testRect);
            }
            pointList = ImageHelpers.GetPoints(EnumShapes.Stars, HowManyStars, otherLocation, false, firstWidth);
            foreach (var thisPoint in pointList)
            {
                var testRect = SKRect.Create(thisPoint, testSize);

                canvas.DrawStar(testRect, _yellowPaint !, _blackBorder !);
            }
        }