//C#
private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
{
if (e.button == 2)
{
IRubberBand rubberband = new RubberCircleClass();
IGeometry geometry = rubberband.TrackNew(this.axMapControl1.ActiveView.ScreenDisplay, null);
CreateCircleElement(geometry, this.axMapControl1.Map);
this.axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}
}
private void CreateCircleElement(IGeometry geometry, IMap map)
{
ISegment segment = geometry as ISegment;
ISegmentCollection polygon = new PolygonClass();
object Missing = Type.Missing;
polygon.AddSegment(segment, ref Missing, ref Missing);
IElement element = new CircleElement();
element.Geometry = polygon as IGeometry;
IGraphicsContainer graphicsContainer = map as IGraphicsContainer;
graphicsContainer.AddElement(element, 0);
}
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2021-09-24
  • 2022-12-23
  • 2021-07-04
  • 2021-10-02
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2021-09-27
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案