Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();
            var FoxDraw = new foxDraw(canvas);

            // Draw the canvas' diagonals.
            // If it starts from the upper-left corner it should be green, otherwise it should be red.

            foxDraw.StrokeColor(Colors.Green);
            foxDraw.DrawLine(0, 0, canvas.Width, canvas.Height);

            foxDraw.StrokeColor(Colors.Red);
            foxDraw.DrawLine(0, canvas.Height, canvas.Width, 0);
        }
        public MainWindow()
        {
            InitializeComponent();
            var FoxDraw = new foxDraw(canvas);
            // Create a line drawing function that takes 2 parameters:
            // The x and y coordinates of the line's starting point
            // and draws a line from that point to the center of the canvas.
            // Draw 3 lines with that function. Use loop for that.

            double a = 0;
            double b = 0;

            for (int i = 0; i < 50; i++)
            {
                foxDraw.DrawLine(a, b, canvas.Width / 2, canvas.Height / 2);
                b += 10;
            }
        }