Arcengine画点的代码

private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
{

IElement pElement;
IMarkerElement pMarkerElement;
ISimpleMarkerSymbol pSimpleMarkerSymbol;
IRgbColor pRgbColor;
pSimpleMarkerSymbol = new SimpleMarkerSymbolClass();
pRgbColor = new RgbColorClass();
pRgbColor.Red = 255;
pSimpleMarkerSymbol.Color = pRgbColor;
pSimpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCross ;
pMarkerElement = new MarkerElementClass();
pMarkerElement.Symbol = pSimpleMarkerSymbol;
pElement = new MarkerElement();
pElement = pMarkerElement as IElement;
pElement.Geometry = axMapControl1.ActiveView.ScreenDisplay.DisplayTransformation. ToMapPoint(e.x, e.y);
IGraphicsContainer pGraphicsContainer = axMapControl1.ActiveView.FocusMap as IGraphicsContainer;
pGraphicsContainer.AddElement(pElement, 0);
axMapControl1.ActiveView.Refresh();

}

posted on 2012-05-30 08:17  jin_qi_er  阅读(300)  评论(0编辑  收藏  举报