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

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

时间:2017-01-19 09:33:03      阅读:726      评论:0      收藏:0      [点我收藏+]

标签:graphics   containe   fresh   ref   view   add   phi   family   int   

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

 

//画点
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中添加点、线、面元素

标签:graphics   containe   fresh   ref   view   add   phi   family   int   

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

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