且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-09-06 20:55:25

转自原文 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();
没有整理与归纳的知识,一文不值!高度概括与梳理的知识,才是自己真正的知识与技能。 永远不要让自己的***、好奇、充满创造力的想法被现实的框架所束缚,让创造力***成长吧! 多花时间,关心他(她)人,正如别人所关心你的。理想的腾飞与实现,没有别人的支持与帮助,是万万不能的。



    本文转自wenglabs博客园博客,原文链接:http://www.cnblogs.com/arxive/p/6885347.html,如需转载请自行联系原作者