码迷,mamicode.com
首页 > 其他好文 > 详细

ArcGIS Engine中添加点、线、面元素

时间:2017-05-21 17:56:39      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:data   on()   mil   方式   element   http   lin   content   ima   

转自原文 ArcGIS Engine中添加点、线、面元素

此种方式为IElement的方式在axMapControlGraphicsContainer中好绘制图形。

 

//画点
IPoint pt = axMapControl1.ToMapPoint(e.x, e.y);
IMarkerElement pMarkerElement = new MarkerElementClass();
IElement pElement = pMarkerElement as IElement;
pElement.Geometry = pt;
IGraphicsContainer pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)pMarkerElement, 0);
pActiveView.Refresh();

//画线
IGeometry polyline = axMapControl1.TrackLine();
ILineElement pLineElement = new LineElementClass();
IElement pElement = pLineElement as IElement;
pElement.Geometry = polyline;
IGraphicsContainer pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)pLineElement, 0);
pActiveView.Refresh();

//画面
IGeometry Polygon = axMapControl1.TrackPolygon();
IPolygonElement PolygonElement = new PolygonElementClass();
IElement pElement = PolygonElement as IElement;
pElement.Geometry = Polygon;
pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)PolygonElement, 0);
 
 
 
pActiveView.Refresh();

ArcGIS Engine中添加点、线、面元素

标签:data   on()   mil   方式   element   http   lin   content   ima   

原文地址:http://www.cnblogs.com/arxive/p/6885347.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!