Exemplo n.º 1
0
        public void SquareDrawerCenter(int size)
        {
            var foxDraw = new FoxDraw(canvas);
            int half    = size / 2;

            for (int i = 1; i < 4; i++)
            {
                foxDraw.StrokeColor(Colors.Crimson);
                foxDraw.DrawLine(canvas.Width / 2 - half, canvas.Height / 2 - half, canvas.Width / 2 + half, canvas.Height / 2 - half);
                foxDraw.StrokeColor(Colors.Crimson);
                foxDraw.DrawLine(canvas.Width / 2 + half, canvas.Height / 2 - half, canvas.Width / 2 + half, canvas.Height / 2 + half);
                foxDraw.StrokeColor(Colors.Crimson);
                foxDraw.DrawLine(canvas.Width / 2 + half, canvas.Height / 2 + half, canvas.Width / 2 - half, canvas.Height / 2 + half);
                foxDraw.StrokeColor(Colors.Crimson);
                foxDraw.DrawLine(canvas.Width / 2 - half, canvas.Height / 2 - half, canvas.Width / 2 - half, canvas.Height / 2 + half);
                half += 15;
            }
        }
        private void DrawCenterSquare(double a)
        {
            var foxDraw = new FoxDraw(canvas);

            Color color = new Color();

            color = Color.FromRgb((byte)rnd.Next(256), (byte)rnd.Next(256), (byte)rnd.Next(256));
            foxDraw.StrokeColor(color);

            Color fillColor = new Color();

            fillColor = Color.FromArgb(0, 0, 0, 0);
            foxDraw.FillColor(fillColor);

            double centerZ = canvas.Width / 2 - a / 2;
            double centerY = canvas.Height / 2 - a / 2;

            foxDraw.DrawRectangle(centerZ, centerY, a, a);
        }