在MapControl绘制多边形
- MapControl的OnMouseDown事件
主要代码:
private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
{
IGeometry pGe = axMapControl1.TrackPolygon();
IElement pElement = new PolygonElementClass() as IElement;
pElement.Geometry = pGe;
IGraphicsContainer GraphicsContainer = axMapControl1.Map as IGraphicsContainer;
GraphicsContainer.AddElement(pElement, 0);
axMapControl1.ActiveView.Refresh();
}
版权声明:本文为qq_51640369原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。