地圖座標和頁面座標的轉換應用
阿新 • • 發佈:2019-02-08
private void axMapControl1_OnMouseMove(object sender, IMapControlEvents2_OnMouseMoveEvent e)
{
IActiveView m_activeview = axMapControl1.Map as IActiveView;
IPoint point = new PointClass();
System.Drawing.Point p = System.Windows.Forms.Cursor.Position;
this.toolStripStatusLabel1.Text = "X: " + System.Convert.ToString(p.X) + " Y: " + System.Convert.ToString(p.Y);
point = m_activeview.ScreenDisplay.DisplayTransformation.ToMapPoint(e.x, e.y);
label5.Text = "X: " + Convert.ToString(point.X) + " Y: " + Convert.ToString(point.Y);
double w ;
w = 40 ;
label6.Text = "大小值:" + Convert.ToString(w);
}
{
IActiveView m_activeview = axMapControl1.Map as IActiveView;
IPoint point = new PointClass();
System.Drawing.Point p = System.Windows.Forms.Cursor.Position;
this.toolStripStatusLabel1.Text = "X: " + System.Convert.ToString(p.X) + " Y: " + System.Convert.ToString(p.Y);
point = m_activeview.ScreenDisplay.DisplayTransformation.ToMapPoint(e.x, e.y);
label5.Text = "X: " + Convert.ToString(point.X) + " Y: " + Convert.ToString(point.Y);
double w ;
w = 40 ;
label6.Text = "大小值:" + Convert.ToString(w);
}