コード例 #1
0
ファイル: MeasureBox.cs プロジェクト: siegleal/iSanta
 private void MeasureBox_MouseUp(object sender, MouseEventArgs e)
 {
     _grabbedPoint = GrabbedPoint.None;
 }
コード例 #2
0
ファイル: MeasureBox.cs プロジェクト: siegleal/iSanta
        private void MeasureBox_MouseDown(object sender, MouseEventArgs e)
        {
            if (_mode == Mode.Manipulate) {
                switch (e.Button)
                {
                    case MouseButtons.Left:
                        Point down = Box2ImageCoord(e.Location);
                        if (Near(down, _scaling.vertical, POINT_SIZE / _zoom))
                        {
                            _grabbedPoint = GrabbedPoint.Vertical;
                        }
                        else if (Near(down, _scaling.middle, POINT_SIZE / _zoom))
                        {
                            _grabbedPoint = GrabbedPoint.Middle;
                        }
                        else if (Near(down, _scaling.horizontal, POINT_SIZE / _zoom))
                        {
                            _grabbedPoint = GrabbedPoint.Horizontal;
                        }
                        else if (Near(down, _topLeft, POINT_SIZE / _zoom))
                        {
                            _grabbedPoint = GrabbedPoint.ROI_TopLeft;
                        }
                        else if (Near(down, new Point(_bottomRight.X, _topLeft.Y), POINT_SIZE / _zoom))
                        {
                            _grabbedPoint = GrabbedPoint.ROI_TopRight;
                        }
                        else if (Near(down, new Point(_topLeft.X, _bottomRight.Y), POINT_SIZE / _zoom))
                        {
                            _grabbedPoint = GrabbedPoint.ROI_BottomLeft;
                        }
                        else if (Near(down, _bottomRight, POINT_SIZE / _zoom))
                        {
                            _grabbedPoint = GrabbedPoint.ROI_BottomRight;
                        }
                        break;
                    case MouseButtons.Right:
                        _grabbedPoint = GrabbedPoint.AllScale;

                        _reference = Box2ImageCoord(e.Location);
                        break;
                }
            }
        }