ESRI.ArcGIS.esriSystem名称空间问题

本文介绍了解决ESRI.ArcGIS.esriSystem引用缺失的方法,指出只需添加ESRI.ArcGIS.System引用即可解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

     ESRI.ArcGIS.esriSystem,在引用里是没有的,其实只要添加ESRI.ArcGIS.System这个引用即可~~~
using System; using System.Drawing; using System.Linq; using System.Text; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Runtime.InteropServices; using MapControlApplication1; using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.Carto; using ESRI.ArcGIS.Controls; using ESRI.ArcGIS.ADF; using ESRI.ArcGIS.SystemUI; using AE_test; using ESRI.ArcGIS.Display; using ESRI.ArcGIS.DataSourcesRaster; using ESRI.ArcGIS.Geodatabase; using ESRI.ArcGIS.Geometry; using ESRI.ArcGIS.Desktop.AddIns; namespace MapControlApplication1 { public delegate void AfterDrawGeometry(IGeometry geometry); public class DrawPolygoncs : ITool { private IGeometry _polygon=null;//定义一个几何对象,作为绘制结果 private INewPolygonFeedback _polyFeedback=null;//定义一个多边形反馈对象 private IPoint _startPoint=null;//多边形起始结点 private IPoint _endPoint=null;//多边形终止结点 private bool _drawStart=false;//多边形绘制开始标记 public event AfterDrawGeometry eventAfterDrawGeometry; protected AxMapControl myMapControl=null; protected ESRI.ArcGIS.Controls.IHookHelper myHook; //返回结果多边形 public IGeometry Polygon { get{ return _polygon;} } public override void OnCreate(object hook) { myHook.Hook= hook; if(myHook == null) myHook=new ESRI.ArcGIS.Controls.HookHelperClass(); if(_drawStart) { (myHook.Hook as IMapControl3).CurrentTool=this; _polyFeedback = new NewPolygonFeedbackClass(); _polyFeedback.Display=myHook.ActiveView.ScreenDisplay; } } public override void OnClick()//单击鼠标开始绘图或添加结点 { _polygon=null;//每次重设多边形为空值 _drawStart=true;//开始绘制标记置为true (myHook.Hook as IMapControl).CurrentTool=this; _polyFeedback=new NewPolygonFeedbackClass(); _polyFeedback.Display=myHook. ActiveView. ScreenDisplay; } public override void OnMouseDown(int Button, int Shift, int X, int Y) { if(Button ==1) { if(_startPoint == null)//如果是多边形第一个结点 { _startPoint =(myHook.FocusMap as IActiveView).ScreenDisplay. DisplayTransformation.ToMapPoint(X,Y); _polyFeedback.Start(_startPoint);//开始多边形绘制 } else { _endPoint =(myHook.FocusMap as IActiveView).ScreenDisplay. DisplayTransformation.ToMapPoint(X,Y); _polyFeedback.AddPoint(_endPoint);//添加多边形绘制结点 } } } public override void OnMouseMove(int Button, int Shift, int X, int Y) { if(_startPoint !=null) { IPoint movePoint=(myHook.FocusMap as IActiveView).ScreenDisplay. DisplayTransformation.ToMapPoint(X,Y); _polyFeedback.MoveTo(movePoint);//鼠标移动过程中实时显示反馈效果 } } public override void Refresh(int hDC) { base.Refresh(hDC); if (_polyFeedback !=null) { (_polyFeedback as IDisplayFeedback).Refresh(hDC);//实时显示反馈效果 } } public override void OnDblClick()//双击鼠标结束绘图 { _polygon=_polyFeedback.Stop(); _startPoint=null; _drawStart=false; } int ITool.Cursor { get { return 0; } // 返回默认光标 } bool ITool.Deactivate() { return true; // 允许工具取消激活 } bool ITool.OnContextMenu(int x, int y) { return false; // 不处理右键菜单 } void ITool.OnDblClick() { OnDblClick(); // 调用自定义的双击事件 } public void OnKeyDown(int keyCode, int shift) { throw new NotImplementedException(); } public void OnKeyUp(int keyCode, int shift) { throw new NotImplementedException(); } public void OnMouseUp(int button, int shift, int x, int y) { throw new NotImplementedException(); } } }
06-12
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

天下布武8

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值