现在的位置: 首页 > 综合 > 正文

ARCGIS ENGINE + C#画点、线、面

2013年06月23日 ⁄ 综合 ⁄ 共 975字 ⁄ 字号 评论关闭

ARCGIS ENGINE + C#画点、线、面  


画点
IPoint pt;
pt = axMapControl1.ToMapPoint(e.x, e.y);
IMarkerElement pMarkerElement;
pMarkerElement = new MarkerElementClass();
IElement pElement;
pElement = pMarkerElement as IElement;
pElement.Geometry = pt;
pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)pMarkerElement, 0);
pActiveView.Refresh();
画线
IGeometry polyline;
polyline = axMapControl1.TrackLine();
ILineElement pLineElement;
pLineElement = new LineElementClass();
IElement pElement;
pElement = pLineElement as IElement;
pElement.Geometry = polyline;
pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)pLineElement, 0);
pActiveView.Refresh();
画面
IGeometry Polygon;
Polygon = axMapControl1.TrackPolygon();
IPolygonElement PolygonElement;
PolygonElement = new PolygonElementClass();
IElement pElement;
pElement = PolygonElement as IElement;
pElement.Geometry = Polygon;
pGraphicsContainer = pMap as IGraphicsContainer;
pGraphicsContainer.AddElement((IElement)PolygonElement, 0);
pActiveView.Refresh();

抱歉!评论已关闭.