Example #1
0
        void DrawEllips(Graphics graphics)
        {
            Grid grid = new Grid();

            int pixelsSize = int.Parse(textBox1.Text);

            grid.DrawGrid(graphics, 0, 0, pictureBox1.Width, pictureBox1.Height, pixelsSize);
            int Ex1    = int.Parse(textBoxX1Ellips.Text);
            int Ey1    = int.Parse(textBoxY1Ellips.Text);
            int width  = int.Parse(textBoxWidthEllips.Text);
            int height = int.Parse(textBoxHeightEllips.Text);

            BresenhamAlgorithm bresenhamAlgorithm = new BresenhamAlgorithm();

            bresenhamAlgorithm.DrawEllips(graphics, grid, Ex1, Ey1, width, height);
        }
Example #2
0
        void Draw(Graphics graphics)
        {
            Grid grid = new Grid();

            int pixelsSize = int.Parse(textBox1.Text);

            grid.DrawGrid(graphics, 0, 0, pictureBox1.Width, pictureBox1.Height, pixelsSize);

            int x1 = int.Parse(textBoxX1.Text);
            int y1 = int.Parse(textBoxY1.Text);
            int x2 = int.Parse(textBoxX2.Text);
            int y2 = int.Parse(textBoxY2.Text);

            BresenhamAlgorithm bresenhamAlgorithm = new BresenhamAlgorithm();

            bresenhamAlgorithm.DrawBresenhamLine(graphics, grid, x1, y1, x2, y2);
        }