public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var canvas = this.Get <Canvas>("canvas"); var foxDraw = new FoxDraw(canvas); // Draw a box that has different colored lines on each edge. foxDraw.SetStrokeThicknes(3); // line a foxDraw.SetStrokeColor(Colors.Aqua); foxDraw.DrawLine(10, 10, 200, 10); // line b foxDraw.SetStrokeColor(Colors.Blue); foxDraw.DrawLine(200, 10, 200, 200); // line c foxDraw.SetStrokeColor(Colors.Chartreuse); foxDraw.DrawLine(10, 200, 200, 200); // line d foxDraw.SetStrokeColor(Colors.DarkGreen); foxDraw.DrawLine(10, 10, 10, 200); }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var canvas = this.Get <Canvas>("canvas"); var foxDraw = new FoxDraw(canvas); double canvasSize = 400; double x1 = 20; double x2 = canvasSize; double y1 = 0; double y2 = 20; /*foxDraw.DrawLine(x, 0, canvasSize, y); * foxDraw.DrawLine(x + 20, 0, canvasSize, y + 20); * foxDraw.DrawLine(x + 40, 0, canvasSize, y + 40);*/ for (int i = 0; i < 19; i++) { foxDraw.SetStrokeColor(Colors.Violet); foxDraw.DrawLine(x1, y1, x2, y2); foxDraw.SetStrokeColor(Colors.LawnGreen); foxDraw.DrawLine(y1, x1, y2, x2); x1 += 20; y2 += 20; } }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var canvas = this.Get <Canvas>("canvas"); var foxDraw = new FoxDraw(canvas); var startPointTop = new Point(200, 200); var endPointTop = new Point(600, 200); var startPointLeft = new Point(200, 200); var endPointLeft = new Point(200, 600); var startPointRight = new Point(600, 200); var endPointRight = new Point(600, 600); var startPointBottom = new Point(200, 600); var endPointBottom = new Point(600, 600); foxDraw.SetStrokeColor(Colors.Red); foxDraw.DrawLine(startPointTop, endPointTop); foxDraw.SetStrokeColor(Colors.Blue); foxDraw.DrawLine(startPointLeft, endPointLeft); foxDraw.SetStrokeColor(Colors.Yellow); foxDraw.DrawLine(startPointRight, endPointRight); foxDraw.SetStrokeColor(Colors.Green); foxDraw.DrawLine(startPointBottom, endPointBottom); }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var canvas = this.Get <Canvas>("canvas"); var foxDraw = new FoxDraw(canvas); foxDraw.SetBackgroundColor(Colors.Black); double canvasHeight = canvas.Height = 600; double canvasWidth = canvas.Width = 600; // Draw a box that has different colored lines on each edge. int x = 100; int y = 100; foxDraw.SetStrokeColor(Colors.Blue); foxDraw.DrawLine(x, y, 300, 100); foxDraw.SetStrokeColor(Colors.Red); foxDraw.DrawLine(x, y, 100, 300); foxDraw.SetStrokeColor(Colors.White); foxDraw.DrawLine(300, 100, 300, 300); foxDraw.SetStrokeColor(Colors.Green); foxDraw.DrawLine(300, 300, 100, 300); }
public static void DrawLines(FoxDraw foxDraw, int sirka, int vyska) { sirka = 0; vyska = 20; foxDraw.SetStrokeThicknes(3); int horizontal = 50; int vertical = 20; Console.Write("How many lines do you want? : "); int lines = Convert.ToInt32(Console.ReadLine()); for (int i = 0; i < lines; i++) { foxDraw.DrawLine(sirka, vyska, horizontal, vertical); vyska += 20; horizontal += 50; vertical += 20; if (i % 2 == 0) { foxDraw.SetStrokeColor(Colors.Blue); } else { foxDraw.SetStrokeColor(Colors.Black); } } }
private void Diagonals(FoxDraw foxDraw) { // Draw the canvas' diagonals. // If it starts from the upper-left corner it should be green, otherwise it should be red. for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { double x = Width * i; double y = Width * j; double a = Width - Width * i; double b = Width - Width * j; Point start = new Point(x, y); Point zero = new Point(0, 0); if (start.Equals(zero)) { foxDraw.SetStrokeColor(Colors.Green); } else { foxDraw.SetStrokeColor(Colors.Red); } foxDraw.DrawLine(start, new Point(a, b)); } } }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var canvas = this.Get <Canvas>("canvas"); var foxDraw = new FoxDraw(canvas); canvas.Width = 400; canvas.Height = 400; foxDraw.SetBackgroundColor(Colors.Wheat); foxDraw.SetStrokeColor(Colors.Red); foxDraw.DrawLine(0, 0, canvas.Width, 0); foxDraw.SetStrokeColor(Colors.Green); foxDraw.DrawLine(canvas.Width, 0, canvas.Height, canvas.Height); foxDraw.SetStrokeColor(Colors.Blue); foxDraw.DrawLine(0, canvas.Height, canvas.Height, canvas.Height); foxDraw.SetStrokeColor(Colors.Black); foxDraw.DrawLine(0, 0, 0, canvas.Height); }
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); foxDraw.SetBackgroundColor(Colors.Black); /*----------------------------------------------------------------------------------------------------------*/ //Line play int a = 0; for (int i = 0; i < 15; i++) { foxDraw.SetStrokeColor(Colors.Purple); foxDraw.DrawLine(300, a, 300 + a, 300); a += 20; foxDraw.SetStrokeColor(Colors.Cyan); foxDraw.DrawLine(300, a, 300 - a, 300); foxDraw.SetStrokeColor(Colors.Cyan); foxDraw.DrawLine(300, a, 300 - a, 300); //foxDraw.SetStrokeColor(Colors.LawnGreen); //foxDraw.DrawLine(0, i, i, Width); } }
public static void DrawLine(FoxDraw foxDraw) { foxDraw.SetStrokeColor(Colors.Red); foxDraw.DrawLine(0, 200, 400, 200); foxDraw.SetStrokeColor(Colors.Green); foxDraw.DrawLine(200, 0, 200, 400); }
public void DrawMoon(FoxDraw foxDraw, int x, int y) { foxDraw.SetStrokeColor(Colors.Silver); foxDraw.SetFillColor(Colors.Silver); foxDraw.DrawEllipse(x - 50, y - 50, 100, 100); foxDraw.SetStrokeColor(Colors.Black); foxDraw.SetFillColor(Colors.Black); foxDraw.DrawEllipse(x - 100, y - 60, 120, 120); }
private void LineInTheMiddle(FoxDraw FoxDraw) { // draw a red horizontal line to the canvas' middle. // draw a green vertical line to the canvas' middle. FoxDraw.SetStrokeColor(Colors.Red); FoxDraw.DrawLine(Middlepoint(), new Point(0, Width / 2)); FoxDraw.SetStrokeColor(Colors.Green); FoxDraw.DrawLine(Middlepoint(), new Point(Height / 2, 0)); }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var canvas = this.Get <Canvas>("canvas"); var foxDraw = new FoxDraw(canvas); canvas.Width = 800; canvas.Height = 800; string timeNow = DateTime.Now.ToString("HH:mm"); Random random = new Random(); string hours = string.Join("", timeNow[0], timeNow[1]); // int hour = int.Parse(hours); // getting current time into integer int hour = 23; // sets time manually if (hour > 7 && hour < 20) { foxDraw.SetBackgroundColor(Colors.LightBlue); if (hour <= 13) { DrawSun(foxDraw, 100 + ((hour - 7) * 50), 500 - ((hour - 7) * 50)); } else { DrawSun(foxDraw, 100 + ((hour - 7) * 50), 100 + ((hour - 13) * 50)); } } else { foxDraw.SetBackgroundColor(Colors.Black); for (int i = 0; i < random.Next(100, 200); i++) { foxDraw.SetStrokeColor(Colors.Yellow); foxDraw.DrawRectangle(random.Next(0, 800), random.Next(0, 800), 3, 3); } foxDraw.SetStrokeColor(Colors.Transparent); if (hour >= 20 && hour <= 23) { DrawMoon(foxDraw, 100 + ((hour - 19) * 50), 500 - ((hour - 19) * 50)); } else if (hour < 2) { DrawMoon(foxDraw, 100 + ((hour + 5) * 50), 500 - ((hour + 5) * 50)); } else { DrawMoon(foxDraw, 100 + ((hour + 5) * 50), 100 + ((hour - 1) * 50)); } } if (true) { } }
public void DrawFourColoredRectangle(FoxDraw foxDraw, double canvasSize) { foxDraw.SetStrokeThicknes(2); foxDraw.SetStrokeColor(Colors.DarkGreen); foxDraw.DrawLine(canvasSize / 10, canvasSize / 10, (canvasSize / 10) * 2, canvasSize / 10); foxDraw.SetStrokeColor(Colors.DarkOrange); foxDraw.DrawLine(canvasSize / 10, (canvasSize / 10) * 2, canvasSize / 10, canvasSize / 10); foxDraw.SetStrokeColor(Colors.DarkMagenta); foxDraw.DrawLine((canvasSize / 10) * 2, canvasSize / 10, (canvasSize / 10) * 2, (canvasSize / 10) * 2); foxDraw.SetStrokeColor(Colors.DarkViolet); foxDraw.DrawLine(canvasSize / 10, (canvasSize / 10) * 2, (canvasSize / 10) * 2, (canvasSize / 10) * 2); }
public static void DrawGreenDiagonal(FoxDraw foxDraw, double x1, double y1, double x2, double y2) { if (x1 == 0 && y1 == 0) { foxDraw.SetStrokeColor(Colors.Green); foxDraw.DrawLine(x1, y1, x2, y2); } else { foxDraw.SetStrokeColor(Colors.Blue); foxDraw.DrawLine(x1, y1, x2, y2); } }
private void EnvelopeStar(FoxDraw foxDraw) { for (int i = 0; i <= 800; i += 20) { foxDraw.SetStrokeColor(Color.Parse("#232528")); foxDraw.DrawLine(400, 0, i, 400); foxDraw.SetStrokeColor(Color.Parse("#232528")); foxDraw.DrawLine(400, 800, i, 400); if (i != 400) { foxDraw.SetStrokeColor(Color.Parse("#232528")); foxDraw.DrawLine(0, 400, 400, i); foxDraw.SetStrokeColor(Color.Parse("#232528")); foxDraw.DrawLine(800, 400, 400, i); } foxDraw.SetStrokeColor(Color.Parse("#232528")); foxDraw.SetFillColor(Colors.White); foxDraw.DrawEllipse(-400, -400, 800, 800); foxDraw.SetStrokeColor(Color.Parse("#232528")); foxDraw.SetFillColor(Colors.White); foxDraw.DrawEllipse(400, -400, 800, 800); foxDraw.SetStrokeColor(Color.Parse("#232528")); foxDraw.SetFillColor(Colors.White); foxDraw.DrawEllipse(-400, 400, 800, 800); foxDraw.SetStrokeColor(Color.Parse("#232528")); foxDraw.SetFillColor(Colors.White); foxDraw.DrawEllipse(400, 400, 800, 800); } }
private void ColoredBox(FoxDraw foxDraw) { double startingCoordinateX = 50; double startingCoordinateY = 50; double length = 50; Point startingPoint = new Point(startingCoordinateX, startingCoordinateY); Point endingPoint = new Point(startingCoordinateX + length, startingCoordinateY + length); foxDraw.SetStrokeColor(RandomColor()); foxDraw.DrawLine(startingPoint, new Point(50 + length, 50)); foxDraw.SetStrokeColor(RandomColor()); foxDraw.DrawLine(startingPoint, new Point(50, 50 + length)); foxDraw.SetStrokeColor(RandomColor()); foxDraw.DrawLine(new Point(50 + length, 50), endingPoint); foxDraw.SetStrokeColor(RandomColor()); foxDraw.DrawLine(new Point(50, 50 + length), endingPoint); //for (int horizontal = 1; horizontal < 3; horizontal++) //{ // for (int vertical = 1; vertical < 3; vertical++) { // double length = 50 // double x = 0 + length * horizontal; // double y = 50 + (50 * j); // double a = 100 - 50 * i; // double b = 100 - 50 * j; // foxDraw.SetStrokeColor(RandomColor()); // foxDraw.DrawLine(new Point(x, ), new Point(a, a)); // } // for () { } //for (int vertical = 1; vertical < 3; vertical++) //{ // for (int horizontal = 0; horizontal < 2; horizontal++) // { // foxDraw.SetStrokeColor(RandomColor()); // if (vertical % 2 != 0) // { // foxDraw.DrawLine(startingPoint, new Point(length + length*horizontal); // } // else // { // foxDraw.DrawLine(new Point(50, 50 + length), endingPoint); // } // } //} }
public static void Strokes(FoxDraw foxdraw, int x, int y) { foxdraw.SetStrokeThicknes(1); for (int i = 0; i < 250; i++) { foxdraw.SetStrokeColor(Colors.DarkViolet); foxdraw.DrawLine(500, x, y, 0); foxdraw.SetStrokeColor(Colors.LightGreen); foxdraw.DrawLine(x, 500, 0, y); x += 20; y += 20; } }
private void Diagonals(FoxDraw foxDraw) { // Draw the canvas' diagonals. // If it starts from the upper-left corner it should be green, otherwise it should be red. foxDraw.SetStrokeColor(Colors.Green); var startingPointDiagonalUL = new Point(0, 0); var endingPointDiagonalUL = new Point(800, 800); foxDraw.DrawLine(startingPointDiagonalUL, endingPointDiagonalUL); foxDraw.SetStrokeColor(Colors.Red); var startingPointDiagonalRL = new Point(800, 0); var endingPointDiagonalRL = new Point(0, 800); foxDraw.DrawLine(startingPointDiagonalRL, endingPointDiagonalRL); }
public void DrawLinePlay(FoxDraw foxDraw, double lines) { double numberOfPoints = lines; double distance = Height / numberOfPoints; foxDraw.SetStrokeThicknes(2); for (int i = 0; i < numberOfPoints; i++) { foxDraw.SetStrokeColor(Colors.MediumPurple); foxDraw.DrawLine(distance * i, 0, Height, distance * i); foxDraw.SetStrokeColor(Colors.LimeGreen); foxDraw.DrawLine(0, distance * i, distance * i, Height); } }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var canvas = this.Get <Canvas>("canvas"); var foxDraw = new FoxDraw(canvas); canvas.Width = 1000; canvas.Height = 1000; //LINEINTHEMIDDLE //draw a red horizontal line to the canvas' middle. //draw a green vertical line to the canvas' middle. /* * foxDraw.SetBackgroundColor(Colors.LightYellow); * foxDraw.SetStrokeColor(Colors.Red); * foxDraw.DrawLine(0, canvas.Height / 2, canvas.Width, canvas.Height / 2); * foxDraw.SetStrokeColor(Colors.Green); * foxDraw.DrawLine(canvas.Width/2, 0, canvas.Width/2, canvas.Height); */ //COLOREDBOX // Draw a box that has different colored lines on each edge. /* * foxDraw.SetStrokeColor(Colors.Red); * foxDraw.DrawLine(300, 300, 700, 300); * foxDraw.SetStrokeColor(Colors.Blue); * foxDraw.DrawLine(700, 300, 700, 700); * foxDraw.SetStrokeColor(Colors.Green); * foxDraw.DrawLine(700, 700, 300, 700); * foxDraw.SetStrokeColor(Colors.Yellow); * foxDraw.DrawLine(300, 700, 300, 300); */ //DIAGONALS // Draw the canvas' diagonals. // If it starts from the upper-left corner it should be green, otherwise it should be red. foxDraw.SetStrokeColor(Colors.Green); foxDraw.DrawLine(0, 0, canvas.Width, canvas.Height); foxDraw.SetStrokeColor(Colors.Red); foxDraw.DrawLine(canvas.Width, 0, 0, canvas.Height); }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var canvas = this.Get <Canvas>("canvas"); var foxDraw = new FoxDraw(canvas); canvas.Width = 500; canvas.Height = 500; double triangleSize = 20; double center = canvas.Width / 2; for (double i = 0; i <= canvas.Height; i += triangleSize) { foxDraw.SetStrokeColor(Colors.Black); foxDraw.SetStrokeThicknes(1); //lines point to right bottom foxDraw.DrawLine(center - i / 2, i, canvas.Width - i, canvas.Height); //lines point to left bottom foxDraw.DrawLine(center + i / 2, i, 0 + i, canvas.Height); //horizontal Lines foxDraw.DrawLine(center - (i / 2), i, center + (i / 2), i); } }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif canvas = this.Get<Canvas>("canvas"); foxDraw = new FoxDraw(canvas); DispatcherTimer gameClock = new DispatcherTimer(); gameClock.Interval = new System.TimeSpan(0, 0, 0, 0, 500); gameClock.Tick += delegate { }; gameClock.Start(); foxDraw.SetBackgroundColor(Colors.Black); myFox.Source = new Bitmap("image.png"); foxDraw.AddImage(myFox, 0, 0); foxDraw.SetStrokeColor(Colors.White); foxDraw.DrawLine(100, 100, 400, 400); }
private void DrawLines(FoxDraw foxDraw) { foxDraw.SetBackgroundColor(Colors.Linen); // draw a red horizontal line to the canvas' middle. var startingPointHorizontal = new Point(0, 400); var endingPointHorizontal = new Point(800, 400); foxDraw.SetStrokeColor(Colors.Red); foxDraw.DrawLine(startingPointHorizontal, endingPointHorizontal); // draw a green vertical line to the canvas' middle. var startingPointVertical = new Point(400, 0); var endingPointVertical = new Point(400, 800); foxDraw.SetStrokeColor(Colors.ForestGreen); foxDraw.DrawLine(startingPointVertical, endingPointVertical); }
public static void DrawLine(FoxDraw foxDraw) { foxDraw.SetStrokeThicknes(2); var startPoint = new Point(0, 0); var endPoint = new Point(500, 500); if (startPoint == new Point(0, 0)) { foxDraw.SetStrokeColor(Colors.Green); } else { foxDraw.SetStrokeColor(Colors.Red); } foxDraw.DrawLine(startPoint, endPoint); }
public void Triangle(FoxDraw foxdraw, Canvas canvas, int lineLength) { foxdraw.SetStrokeThicknes(1); foxdraw.SetStrokeColor(Colors.Black); for (int i = 0; i < 200; i += 10) // Lines Horizontal { var startPoint = new Point(95 - i / 2, lineLength + i); var endPoint = new Point(105 + i / 2, lineLength + i); foxdraw.DrawLine(startPoint, endPoint); } for (int i = 0; i < 200; i += 10) // Lines Diagonal | Left to Right { var startPoint = new Point(i, canvas.Height); var endPoint = new Point(100 + i / 2, i); foxdraw.DrawLine(startPoint, endPoint); } for (int i = 0; i <= 200; i += 10) // Lines Diagonal | Right to Left { var startPoint = new Point(i, canvas.Height); var endPoint = new Point(0 + i / 2, canvas.Height - i); foxdraw.DrawLine(startPoint, endPoint); } }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var canvas = this.Get <Canvas>("canvas"); var foxDraw = new FoxDraw(canvas); canvas.Width = 600; canvas.Height = 600; foxDraw.SetStrokeThicknes(1); foxDraw.SetStrokeColor(Colors.Black); DrawSquare(foxDraw, 4, Colors.DarkViolet); /*double startingPoints = 0; * double rectangleSize = 10; * * foxDraw.SetFillColor(Colors.Purple); * for (int i = 0; i < 7; i++) * { * foxDraw.DrawRectangle(startingPoints, startingPoints, rectangleSize, rectangleSize); * startingPoints = startingPoints + rectangleSize; * rectangleSize = rectangleSize * 2; * } */ }
public void Line(FoxDraw foxdraw, int quarter) { foxdraw.SetStrokeThicknes(1); foxdraw.SetStrokeColor(Colors.Green); for (int i = 10; i < 150; i += 10) // Lines Top Right { var startPoint = new Point(quarter, i); var endPoint = new Point(quarter + i, quarter); foxdraw.DrawLine(startPoint, endPoint); } for (int i = 10; i < 150; i += 10) // Lines Top Left { var startPoint = new Point(quarter, i); var endPoint = new Point(quarter - i, quarter); foxdraw.DrawLine(startPoint, endPoint); } for (int i = 10; i < 150; i += 10) // Bottom Right { var startPoint = new Point(quarter + i, quarter); var endPoint = new Point(quarter, 300 - i); foxdraw.DrawLine(startPoint, endPoint); } for (int i = 10; i < 150; i += 10) // Bottom Left { var startPoint = new Point(i, quarter); var endPoint = new Point(quarter, quarter + i); foxdraw.DrawLine(startPoint, endPoint); } }
public void DrawHexBottom(FoxDraw foxDraw, double originX, double originY) { foxDraw.SetStrokeColor(Colors.Blue); foxDraw.DrawLine(originX, originY, originX + 6, originY + 12); //foxDraw.DrawLine(originX + 6, originY + 12, originX + 18, originY + 12); foxDraw.DrawLine(originX + 18, originY + 12, originX + 24, originY); }
public void FancyLineThing(FoxDraw foxDraw, Canvas canvas, int spaceBetween, Color color, double originX, double originY, double size, string direction) { foxDraw.SetStrokeColor(color); for (int lines = 0; lines <= size; lines += spaceBetween) { switch (direction) { case "top left": foxDraw.DrawLine(originX, originY + lines, originX + lines, size + originY); break; case "top right": foxDraw.DrawLine(size + originX, lines + originY, size - lines + originX, size + originY);; break; case "bottom left": foxDraw.DrawLine(originX, size - lines + originY, lines + originX, originY); break; case "bottom right": foxDraw.DrawLine(size + originX, size - lines + originY, size - lines + originX, originY); break; } } }
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); /*----------------------------------------------------------------------------------------------------------*/ // Create a function that draws a single line and takes 3 parameters: // the x and y coordinates of the line's starting point and the // foxDraw and draws a line from that point to the center of the // canvas. // Fill the canvas with lines from the edges, every 20 px, to the center. foxDraw.SetStrokeColor(Colors.Black); for (int j = 0; j <= canvasWidth; j += 20) { GoToCenter(foxDraw, 0, j); GoToCenter(foxDraw, j, 600); GoToCenter(foxDraw, 600, j); GoToCenter(foxDraw, j, 0); } }