Ejemplo n.º 1
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            if (isNewObjectAdded == false)
            {
                return;
            }
            Point     point = new Point(e.X, e.Y);
            int       index = CC.FindObjectIndex(CC.ID);
            DrawCurve w     = (DrawCurve)CC.graphicsList[index];

            if (e.Button == MouseButtons.Left)
            {
                int dx       = myLastPoint.X - point.X;
                int dy       = myLastPoint.Y - point.Y;
                int distance = (int)Math.Sqrt(dx * dx + dy * dy);
                if (distance < minDistance)
                {
                    if (w.PointList.Count > 1)
                    {
                        w.MoveHandleTo(point, w.HandleCount);
                    }
                }
                else
                {
                    w.PointList.Add(point);
                    myLastPoint = point;
                }
            }
            CC.panel.Refresh();
        }
Ejemplo n.º 2
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            if (isNewObjectAdded == false)
            {
                return;
            }
            Point point = new Point(e.X, e.Y);
            int   index = CC.FindObjectIndex(CC.ID);

            if (e.Button == MouseButtons.Left)
            {
                DrawText w = (DrawText)CC.graphicsList[index];
                w.MoveHandleTo(point, 2);
            }
            CC.panel.Refresh();
        }
Ejemplo n.º 3
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            if (isNewObjectAdded == false)
            {
                return;
            }
            int           index = CC.FindObjectIndex(CC.ID);
            DrawRectangle w     = (DrawRectangle)CC.graphicsList[index];

            if (e.Button == MouseButtons.Left)
            {
                int       x    = w.objRectangle.X;
                int       y    = w.objRectangle.Y;
                Rectangle rect = new Rectangle(x, y, e.X - x, e.Y - y);
                w.objRectangle = rect;
            }
            CC.panel.Refresh();
        }