Exemplo n.º 1
0
        /// 鼠标移动
        protected override void OnMouseMove(MouseEventArgs e)
        {
            Pos_Mouse = trans.ScreenToWorld((float)e.X / this.Width, (float)e.Y / this.Height);

            coordinate = String.Format("X:{0} Y:{1}",
                                       Convert.ToString(Math.Round(Pos_Mouse.X, 3)),
                                       Convert.ToString(Math.Round(Pos_Mouse.Y, 3)));

            //objSnap.Snap(data, new WPoint2D(Pos_Mouse.X, Pos_Mouse.Y), RParas.Mode);

            /////用于鼠标拖拽
            if (Move_Mouse == true)
            {
                Rate2ViewPort = this.Width / trans.Viewport.Width;
                Pos_Move      = new PointF(e.X, e.Y);

                this.DragMove((Pos_Move.X - Pos_Orin.X) / Rate2ViewPort, (Pos_Orin.Y - Pos_Move.Y) / Rate2ViewPort);
            }
            this.Invalidate();
            base.OnMouseMove(e);
        }