在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();
}