public MainWindow()
        {
            InitializeComponent();
            var foxDraw = new FoxDraw(canvas);

            double x = canvas.Width / 8;
            double y = canvas.Width / 8;

            for (int j = 0; j < 8; j++)
            {
                if (j % 2 != 0)
                {
                    foxDraw.FillColor(Colors.Black);
                }
                else
                {
                    foxDraw.FillColor(Colors.White);
                }
                foxDraw.DrawRectangle(x, y, y, y);
                x += y;
            }
            for (int i = 0; i < 8; i++)
            {
                if (i % 2 != 0)
                {
                    foxDraw.FillColor(Colors.White);
                }
                else
                {
                    foxDraw.FillColor(Colors.Black);
                }
                foxDraw.DrawRectangle(y, x, y, y);
                x += y;
            }
        }
示例#2
0
        private void CheckerIt(FoxDraw foxDraw, int boxes)
        {
            foxDraw.FillColor(Colors.Black);
            double size = canvas.Height / boxes;

            foxDraw.DrawLine(0, 0, 0, size * boxes);
            foxDraw.DrawLine(0, 0, size * boxes, 0);
            foxDraw.DrawLine(size * boxes, 0, size * boxes, size * boxes);
            foxDraw.DrawLine(0, size * boxes, size * boxes, size * boxes);

            for (int i = 0; i < boxes / 2; i++)
            {
                for (int j = 0; j < boxes; j++)
                {
                    if (j % 2 == 1) // odd lines
                    {
                        foxDraw.DrawRectangle(2 * i * size + size, j * size, size, size);
                    }
                    if (j % 2 == 0)// even lines
                    {
                        foxDraw.DrawRectangle(2 * i * size, j * size, size, size);
                    }
                }
            }
        }
 public void StartWithBlack(FoxDraw draw, int x, int y)
 {
     draw.FillColor(Colors.Black);
     draw.DrawRectangle(x * 10, y * 10, 10, 10);
     draw.FillColor(Colors.White);
     draw.DrawRectangle(x * 10, y * 10, 10, 10);
 }
 public static void PurpleSteps3D(FoxDraw foxDraw)
 {
     foxDraw.DrawRectangle(0, 0, 20, 20);
     foxDraw.SetFillColor(Colors.Purple);
     for (int i = 0; i <= 15; i++)
     {
         foxDraw.DrawRectangle((0 + (i * 30)) + (5 * i), (0 + (i * 30)) + (5 * i), 20 + (i * 5), 20 + (i * 5));
     }
 }
 public static void PositionSquare(FoxDraw foxDraw)
 {
     foxDraw.DrawRectangle(0, 0, 50, 50);
     foxDraw.SetFillColor(Colors.Tomato);
     for (int i = 0; i < 3; i++)
     {
         foxDraw.DrawRectangle((i * 40) + 0, (i * 40) + 0, 50, 50);
     }
 }
 /*        public static void RainbowBoxes(FoxDraw foxDraw)
  *      {
  *          List<Color> colors = new List<Color> { Colors.LightSteelBlue, Colors.LightYellow, Colors.LightYellow, Colors.Indigo, Colors.Lavender };
  *          foxDraw.DrawRectangle(200, 400, 50, 50);
  *          for (int i = 0; i < 10; i++)
  *          {
  *              foxDraw.DrawRectangle((i * 45) + 100, (i * 45) + 800, 50, 50);
  *              foxDraw.SetFillColor(colors[i]);
  *          }
  *      }*/
 public static void PurpleSteps(FoxDraw foxDraw)
 {
     foxDraw.DrawRectangle(0, 0, 20, 20);
     foxDraw.SetFillColor(Colors.Purple);
     for (int i = 0; i <= 40; i++)
     {
         foxDraw.DrawRectangle((i * 20) + 0, (i * 20) + 0, 20, 20);
     }
 }
示例#7
0
        public MainWindow()
        {
            InitializeComponent();          // začátek nevim?
#if DEBUG
            this.AttachDevTools();
#endif
            var canvas  = this.Get <Canvas>("canvas");      //vytvoření canvasu
            var foxDraw = new FoxDraw(canvas);              //vytvoření canvasu

            double canvasWidth  = canvas.Width = 600;       //zadefinování canvasu, protože to je jinak nekonečno
            double canvasHeight = canvas.Height = 600;      //zadefinování canvasu, protože to je jinak nekonečno
                                                            //foxDraw.SetBackgroundColor(Colors.Black);

            /*----------------------------------------------------------------------------------------------------------*/
            // Fill the canvas with a checkerboard pattern.

            foxDraw.SetStrokeColor(Colors.Black);

            for (int j = 0; j < 8; j++)         // loop for adding rows
            {
                if (j % 2 != 0)
                {
                    for (int i = 0; i < 8; i++)                        // loop na změnu barvy kostek
                    {
                        if (i % 2 == 0)
                        {
                            foxDraw.SetFillColor(Colors.Black);
                            foxDraw.DrawRectangle(i * 75, j * 75, 75, 75);
                        }
                        else
                        {
                            foxDraw.SetFillColor(Colors.White);
                            foxDraw.DrawRectangle(i * 75, j * 75, 75, 75);
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < 8; i++)                        // loop na změnu barvy kostek
                    {
                        if (i % 2 != 0)
                        {
                            foxDraw.SetFillColor(Colors.Black);
                            foxDraw.DrawRectangle(i * 75, j * 75, 75, 75);
                        }
                        else
                        {
                            foxDraw.SetFillColor(Colors.White);
                            foxDraw.DrawRectangle(i * 75, j * 75, 75, 75);
                        }
                    }
                }
            }
        }
        public static void CenterBoxFunction(FoxDraw foxDraw)
        {
            List <Color> color = new List <Color> {
                Colors.Gold, Colors.Gray, Colors.Indigo
            };

            foxDraw.DrawRectangle(400, 400, 50, 50);
            for (int i = 0; i < 3; i++)
            {
                foxDraw.DrawRectangle(400, 400, ((i * 20) + 50) * 2, ((i * 20) + 50) * 2);
                foxDraw.SetFillColor(color[i]);
            }
        }
        public static void DrawFour(FoxDraw foxDraw)
        {
            List <Color> colors = new List <Color> {
                Colors.MintCream, Colors.MidnightBlue, Colors.Orange, Colors.PeachPuff
            };

            foxDraw.DrawRectangle(400, 0, 70, 50);
            for (int x = 0; x < 4; x++)
            {
                foxDraw.DrawRectangle((x * 20) + 400, (x * 45) + 0, (x * 20) + 70, (x * 20) + 50);
                foxDraw.SetFillColor(colors[x]);
            }
        }
示例#10
0
        public static void DrawCheckerBoard(FoxDraw foxDraw)
        {
            int x = 30;
            int i = 1;

            foxDraw.FillColor(Colors.Purple);
            foxDraw.DrawRectangle(0, 0, x, x);

            while (i * x < 600)
            {
                foxDraw.FillColor(Colors.Purple);
                foxDraw.DrawRectangle(i * x, i * x, x, x);
                i++;
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            var foxDraw = new FoxDraw(canvas);

            // draw four different size and color rectangles.
            foxDraw.DrawRectangle(10, 10, 100, 100);
            foxDraw.FillColor(Colors.Red);
            foxDraw.DrawRectangle(30, 10, 80, 100);
            foxDraw.FillColor(Colors.Black);
            foxDraw.DrawRectangle(10, 40, 100, 120);
            foxDraw.FillColor(Colors.Blue);
            foxDraw.DrawRectangle(20, 10, 60, 60);
            foxDraw.FillColor(Colors.Green);
        }
示例#12
0
        public MainWindow()
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
            var canvas  = this.Get <Canvas>("canvas");
            var foxDraw = new FoxDraw(canvas);

            ////
            int size      = 10;
            int offset    = 10;
            int increment = 0;
            foxDraw.SetFillColor(Colors.Purple);
            for (int i = 1; i < 10; i++)
            {
                foxDraw.DrawRectangle(offset, offset, size * i, size * i);
                increment = i * size;
                offset   += increment;
            }
#endif

            /*   foxDraw.DrawRectangle(size, size, size, size);
             * foxDraw.DrawRectangle(size*2, size*2, size*2, size*2);
             * foxDraw.DrawRectangle(size*4, size*4, size*3, size*3);
             * foxDraw.DrawRectangle(size*7, size*7, size*4, size*4);*/
        }
示例#13
0
        public MainWindow()
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif
            var canvas  = this.Get <Canvas>("canvas");
            var foxDraw = new FoxDraw(canvas);


            double canvasHeight = canvas.Height = 600;
            double canvasWidth  = canvas.Width = 600;

            // draw four different size and color rectangles.
            // avoid code duplication.

            List <Color> colors = new List <Color> {
                Colors.Blue, Colors.Pink, Colors.Red, Colors.Green, Colors.Yellow
            };

            int i = 0;
            int j = 0;

            foreach (var color in colors)
            {
                i += 30;
                j += 30;
                foxDraw.SetFillColor(color);
                foxDraw.DrawRectangle(i, 30, 20, 20);
            }
        }
示例#14
0
        public MainWindow()
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif
            var canvas  = this.Get <Canvas>("canvas");
            var foxDraw = new FoxDraw(canvas);

            foxDraw.SetBackgroundColor(Colors.Wheat);

            var colors = new List <Color>
            {
                Colors.Red,
                Colors.Blue,
                Colors.Yellow,
                Colors.Pink,
                Colors.Black
            };

            var colorindex = 0;

            for (int i = 10; i < 180; i += 30)
            {
                foxDraw.SetFillColor(colors[colorindex]);
                foxDraw.DrawRectangle(i, 0, 20, 20);
                colorindex++;
                if (colorindex == colors.Count)
                {
                    colorindex = 0;
                }
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            var foxDraw = new FoxDraw(canvas);
            // fill the canvas with a checkerboard pattern.

            int   size        = 250;
            int   pcs         = 600 / size;
            Color firstColor  = Colors.Red;
            Color secondColor = Colors.Yellow;

            for (int i = 0; i < pcs; i++)
            {
                for (int j = 0; j < pcs; j++)
                {
                    if ((i + j) % 2 == 0)
                    {
                        foxDraw.FillColor(firstColor);
                    }
                    else
                    {
                        foxDraw.FillColor(secondColor);
                    }
                    foxDraw.DrawRectangle(size * i, size * j, size, size);
                }
            }
        }
示例#16
0
        public MainWindow()
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
            var canvas  = this.Get <Canvas>("canvas");
            var foxDraw = new FoxDraw(canvas);

            ////
            // draw four different size and color rectangles.
            // avoid code duplication.

            /* var size = 10;
             * var offset = 10;*/
            var rnd       = new Random();
            var randColor = new List <Color>();
            randColor.Add(Colors.AliceBlue);
            randColor.Add(Colors.Purple);
            randColor.Add(Colors.Orange);
            randColor.Add(Colors.Green);


            for (int i = 1; i < 5; i++)
            {
                foxDraw.SetFillColor(randColor[rnd.Next(0, 4)]);
                foxDraw.DrawRectangle(rnd.Next(0, 400), rnd.Next(0, 400), rnd.Next(10, 100), rnd.Next(10, 100));
            }
#endif
        }
示例#17
0
 public void DrawSquare(FoxDraw foxDraw, int width, int height)
 {
     for (int i = 0; i < 3 * 50; i = i + 50)
     {
         foxDraw.DrawRectangle(i, i, width, height);
     }
 }
        public MainWindow()
        {
            InitializeComponent();
            var foxDraw = new FoxDraw(canvas);

            canvas.Background = Brushes.Black;
            Random rnd    = new Random();
            Random random = new Random();

            // Draw the night sky:
            //  - The background should be black
            //  - The stars can be small squares
            //  - The stars should have random positions on the canvas
            //  - The stars should have random color (some shade of grey)

            for (int i = 0; i < 200; i++)
            {
                byte randomNumber = (byte)random.Next(150, 200);
                foxDraw.StrokeColor(Color.FromRgb(randomNumber, randomNumber, randomNumber));
                foxDraw.FillColor(Color.FromRgb(randomNumber, randomNumber, randomNumber));
                int x = rnd.Next(5, 955);
                int y = rnd.Next(5, 995);
                foxDraw.DrawRectangle(x, y, 5, 5);
            }
        }
示例#19
0
        public MainWindow()
        {
            InitializeComponent();
            var container = new FoxDraw(canvas);

            container.FillColor(Colors.Transparent);
            container.StrokeColor(Colors.Black);
            container.DrawRectangle(0, 0, 600, 600);


            var index = 0;

            for (int i = 15; i <= Width; i += 15)
            {
                var PointsOnA = new Point[600 / i];
                var PointsOnB = new Point[600 / i];
                var PointsOnC = new Point[600 / i];
                var PointsOnD = new Point[600 / i];

                PointsOnA[index] = new Point(i, Height);
                PointsOnB[index] = new Point(Width, Height - i);
                PointsOnC[index] = new Point(Width - i, 0);
                PointsOnD[index] = new Point(0, 0 + i);

                var linesOnLeft  = new FoxDraw(canvas);
                var linesOnRight = new FoxDraw(canvas);
                linesOnLeft.DrawLine(PointsOnC[index], PointsOnD[index]);
                linesOnRight.DrawLine(PointsOnA[index], PointsOnB[index]);
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            var foxDraw = new FoxDraw(canvas);

            double x = 0;
            double y = 0;
            double a = canvas.Width / 10;

            for (int i = 0; y < canvas.Height; i++)
            {
                if (i % 2 != 0)
                {
                    x += a;
                }

                for (int j = 0; x < canvas.Width; j++)
                {
                    foxDraw.FillColor(Colors.Black);
                    foxDraw.DrawRectangle(x, y, a, a);
                    x += 2 * a;
                }
                x  = 0;
                y += a;
            }
        }
示例#21
0
        public static void DrawCarpet(FoxDraw drawer, int level, double Height, double Width, double x, double y)
        {
            if (level == 0)
            {
                drawer.DrawRectangle(x, y, Height, Width);
            }
            else
            {
                double wid = Width / 3f;
                double hgt = Height / 3f;
                double x1  = x + wid;
                double y1  = y + hgt;
                double x2  = x + wid * 2f;
                double y2  = y + hgt * 2f;

                drawer.BackgroundColor(Colors.IndianRed);
                drawer.FillColor(Colors.Blue);
                drawer.StrokeColor(Colors.White);

                DrawCarpet(drawer, level - 1, wid, hgt, x, y);
                DrawCarpet(drawer, level - 1, wid, hgt, x1, y);
                DrawCarpet(drawer, level - 1, wid, hgt, x2, y);
                DrawCarpet(drawer, level - 1, wid, hgt, x, y1);
                DrawCarpet(drawer, level - 1, wid, hgt, x2, y1);
                DrawCarpet(drawer, level - 1, wid, hgt, x, y2);
                DrawCarpet(drawer, level - 1, wid, hgt, x1, y2);
                DrawCarpet(drawer, level - 1, wid, hgt, x2, y2);
            }
        }
        private void DrawRainbowBoxes(double sizeX, double sizeY)
        {
            var foxDraw = new FoxDraw(canvas);

            foxDraw.FillColor(Colors.Transparent);
            foxDraw.DrawRectangle(canvas.Width / 2 - sizeX / 2, canvas.Height / 2 - sizeY / 2, sizeX, sizeY);
        }
示例#23
0
        public static void RectangleInCenter(FoxDraw foxDraw, double x, double y)
        {
            double canvasSize = 400;

            foxDraw.SetFillColor(Colors.Transparent);
            foxDraw.DrawRectangle(canvasSize / 2 - x / 2, canvasSize / 2 - y / 2, x, y);
        }
        public MainWindow()
        {
            InitializeComponent();
            var foxDraw = new FoxDraw(canvas);

            // draw four different size and color rectangles.
            // avoid code duplication.

            foxDraw.FillColor(Colors.Blue);
            foxDraw.DrawRectangle(250, 250, 50, 80);

            var points = new List <Point>();

            points.Add(new Point(650, 10));
            points.Add(new Point(750, 10));
            points.Add(new Point(750, 100));
            points.Add(new Point(650, 100));
            foxDraw.FillColor(Colors.Green);
            foxDraw.DrawPolygon(points);

            foxDraw.StrokeColor(Colors.Red);
            foxDraw.DrawLine(50, 50, 160, 50);
            foxDraw.DrawLine(160, 50, 160, 75);
            foxDraw.DrawLine(160, 75, 50, 75);
            foxDraw.DrawLine(50, 75, 50, 50);

            //foxDraw.AddImage(, 450, 450);
        }
示例#25
0
        public MainWindow()
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif
            var canvas  = this.Get <Canvas>("canvas");
            var foxDraw = new FoxDraw(canvas);

            // draw four different size and color rectangles.
            // avoid code duplication.

            double startingPointX = 10;
            double startingPointY = 10;
            double squareWidth    = 30;
            double squareHeight   = 30;

            List <string> colorList = new List <string> {
                "Red", "Green", "Blue", "Yellow"
            };
            //foxDraw.DrawRectangle(startingPointX, startingPointY, squareWidth, squareHeight);
            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < colorList.Count; j++)
                {
                    string color =;
                    foxDraw.SetFillColor(Colors.);
                }

                foxDraw.DrawRectangle(startingPointX, startingPointY, squareWidth, squareHeight);
                startingPointX += 60;
                squareWidth    += 10;
                squareHeight   += 10;
            }
        }
示例#26
0
        public MainWindow()
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif
            var canvas  = this.Get <Canvas>("canvas");
            var foxDraw = new FoxDraw(canvas);


            double canvasHeight = canvas.Height = 600;
            double canvasWidth  = canvas.Width = 600;

            // create a function that draws one square and takes 3 parameters:
            // the x and y coordinates of the square's top left corner
            // and the foxDraw and draws a 50x50 square from that point.
            // draw 3 squares with that function.
            // avoid code duplication.

            int x = 30;
            int y = 30;

            for (int i = 0; i < 8; i++)
            {
                foxDraw.DrawRectangle(x, y, 50, 50);
                x += 60;
                y += 20;
            }
        }
示例#27
0
        public void TripTheFckOut(FoxDraw foxDraw, int size, Color x)
        {
            List <Color> list = new List <Color>();

            list.Add(Colors.Red);
            list.Add(Colors.Orange);
            list.Add(Colors.Yellow);
            list.Add(Colors.Green);
            list.Add(Colors.Blue);
            list.Add(Colors.Purple);

            while (list[0] != x)
            {
                list.Add(list[0]);
                list.Remove(list[0]);
            }

            for (; size > 0; size -= 10)
            {
                foxDraw.FillColor(list[0]);
                foxDraw.DrawRectangle(150 - size / 2, 150 - size / 2, size, size);
                list.Add(list[0]);
                list.Remove(list[0]);
            }
        }
示例#28
0
 public void DrawSquare(FoxDraw foxDraw, int size)
 {
     for (int i = size; i < 80; i += 20)
     {
         foxDraw.DrawRectangle(300 - (i / 2), 300 - (i / 2), i, i);
     }
 }
        public MainWindow()
        {
            InitializeComponent();          // začátek nevim?
#if DEBUG
            this.AttachDevTools();
#endif
            var canvas  = this.Get <Canvas>("canvas");      //vytvoření canvasu
            var foxDraw = new FoxDraw(canvas);              //vytvoření canvasu

            double canvasWidth  = canvas.Width = 600;       //zadefinování canvasu, protože to je jinak nekonečno
            double canvasHeight = canvas.Height = 600;      //zadefinování canvasu, protože to je jinak nekonečno
            foxDraw.SetBackgroundColor(Colors.Black);

            /*----------------------------------------------------------------------------------------------------------*/
            // draw four different size and color rectangles.
            // avoid code duplication.

            List <Color> barvy = new List <Color>()
            {
                Colors.Red, Colors.Blue, Colors.Green, Colors.Yellow
            };

            int i = 1;
            foreach (var barva in barvy)
            {
                foxDraw.SetFillColor(barva);
                foxDraw.DrawRectangle(50, 50 * i, 10 * i, 5 * i);
                ++i;
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            var background = new FoxDraw(canvas);

            background.FillColor(Colors.Black);
            background.DrawRectangle(0, 0, 700, 700);


            Random generalrandom = new Random();
            double numofstars    = generalrandom.Next(300, 500);

            Color[] starcolors = { Colors.Wheat, Colors.LightBlue, Colors.LightGoldenrodYellow, Colors.LightYellow };
            for (int i = 0; i <= numofstars; i++)
            {
                InitializeComponent();

                double sizex = generalrandom.Next(1, 3);
                double sizey = sizex;
                double posx  = generalrandom.Next(0, 700);
                double posy  = generalrandom.Next(0, 700);

                var star = new FoxDraw(canvas);
                star.FillColor(starcolors[generalrandom.Next(0, starcolors.Length - 1)]);
                star.StrokeColor(Colors.White);
                star.DrawEllipse(posx, posy, sizex, sizey);
            }

            int transOrionx = generalrandom.Next(0, 700);
            int transOriony = generalrandom.Next(0, 700);

            Orion(transOrionx, transOriony, starcolors[generalrandom.Next(0, starcolors.Length - 1)]);
        }