예제 #1
0
        private void PictureBox_Paint(object sender, PaintEventArgs e)
        {
            foreach (Shape sh in shapes)
            {
                sh.Draw(e.Graphics);
            }
            switch (Mode)
            {
            case Mode.DrawLine:
                Line line = new Line(X, Y, Color.Black, 2, X1, Y1);
                line.Draw(e.Graphics);
                //e.Graphics.DrawLine(new Pen(buttonColor.BackColor, 2), X, Y, X1, Y1);
                break;

            case Mode.DrawCircle:
                Circle circle = new Circle(X, Y, Color.Black, 2, Rad);
                circle.Draw(e.Graphics);
                //e.Graphics.DrawEllipse(new Pen(buttonColor.BackColor, 2), X - Rad/2, Y - Rad/2, Rad, Rad);
                break;

            case Mode.DrawRectangle:
                ShapeLibrary.Rectangle rectangle = new ShapeLibrary.Rectangle(X, Y, Color.Black, 2, X1, Y1);
                rectangle.Draw(e.Graphics);
                break;

            case Mode.DrawEllipse:
                ShapeLibrary.Elipse elipse = new ShapeLibrary.Elipse(X, Y, Color.Black, 2, Rad, Width);
                elipse.Draw(e.Graphics);
                break;
            }
        }
예제 #2
0
 public Elipse(Elipse elipse) : base(elipse)
 {
     Width = elipse.Width;
 }