小功能:当前鼠标的位置显示(需脚本处理)
当前鼠标的位置的实时显示:
小功能:当前鼠标的位置(需脚本处理)
MapInfo.Tools.MouseTool MouseMove(object sender, MouseEventArgs e)
{
System.Drawing.PointF DisplayPoint = new PointF(e.X,e.Y);
MapInfo.Geometry.DPoint MapPoint = new MapInfo.Geometry.DPoint();
MapInfo.Geometry.DisplayTransform converter = MapControl1.Map.DisplayTransform;
converter.FromDisplay(DisplayPoint, out MapPoint);
Label13.Text = "当前位置:" + MapPoint.x.ToString() + ", " + MapPoint.y.ToString();
return null;
}
MapInfo.Tools.MouseTool MouseMove(object sender, MouseEventArgs e)
{
System.Drawing.PointF DisplayPoint = new PointF(e.X,e.Y);
MapInfo.Geometry.DPoint MapPoint = new MapInfo.Geometry.DPoint();
MapInfo.Geometry.DisplayTransform converter = MapControl1.Map.DisplayTransform;
converter.FromDisplay(DisplayPoint, out MapPoint);
Label13.Text = "当前位置:" + MapPoint.x.ToString() + ", " + MapPoint.y.ToString();
return null;
}