예제 #1
0
        private void FrmMain_MouseUp(object sender, MouseEventArgs e)
        {
            if (currentshape == ShapesTypes.ShapeTypes.CropRect)
            {
                currentshape        = ShapesTypes.ShapeTypes.None;
                MainToolBar.Visible = true;
            }

            if (MainToolBar.Visible == false)
            {
                MainToolBar.Visible = true;
            }

            if (currentshape == ShapesTypes.ShapeTypes.Line)
            {
                Shape shape = new Shape();
                shape.shape  = ShapesTypes.ShapeTypes.Line;
                shape.X      = StartPoint.X;
                shape.Y      = StartPoint.Y;
                shape.Width  = EndPoint.X;
                shape.Height = EndPoint.Y;
                shape.pen    = pen;
                undoactions.AddShape(shape);
            }
            else if (currentshape == ShapesTypes.ShapeTypes.Arrow)
            {
                Shape shape = new Shape();
                shape.shape  = ShapesTypes.ShapeTypes.Arrow;
                shape.X      = StartPoint.X;
                shape.Y      = StartPoint.Y;
                shape.Width  = EndPoint.X;
                shape.Height = EndPoint.Y;
                shape.pen    = pen;
                undoactions.AddShape(shape);
            }
            else if (currentshape == ShapesTypes.ShapeTypes.Rectangle)
            {
                Shape shape = new Shape();
                shape.shape  = ShapesTypes.ShapeTypes.Rectangle;
                shape.X      = RectShape.X;
                shape.Y      = RectShape.Y;
                shape.Width  = RectShape.Width;
                shape.Height = RectShape.Height;
                shape.pen    = pen;
                undoactions.AddShape(shape);
            }
            this.Invalidate();
        }