コード例 #1
0
        public override void DrawImage(SKCanvas dc)
        {
            if (ShapeUsed == (int)EnumShapes.None)
            {
                return;
            }
            dc.Clear();                                                                              // i think
            DrawSelector(dc);                                                                        // i think
            var thisHeight = GetFontSize(40);                                                        // well see how this goes.
            var thisSize   = new SKSize(thisHeight, thisHeight);
            var pointList  = ImageHelpers.GetPoints(ShapeUsed, HowMany, Location, true, thisHeight); // can always be adjusted.   test on desktop first anyways.

            foreach (var thisPoint in pointList)
            {
                var thisRect = SKRect.Create(thisPoint, thisSize);
                if ((int)ShapeUsed == (int)EnumShapes.Balls)
                {
                    dc.DrawOval(thisRect, _redPaint);
                    dc.DrawOval(thisRect, _borderPaint);
                }
                else if ((int)ShapeUsed == (int)EnumShapes.Cones)
                {
                    ImageHelpers.DrawCone(dc, thisRect);
                }
                else if ((int)ShapeUsed == (int)EnumShapes.Cubes)
                {
                    ImageHelpers.DrawCube(dc, thisRect);
                }
                else if ((int)ShapeUsed == (int)EnumShapes.Stars)
                {
                    dc.DrawStar(thisRect, _yellowPaint, _borderPaint);
                }
            }
        }