1 private void AddPointElement(IPoint pPoint)
2 {
3 if (pPoint != null)
4 {
5 IElement pElement = null;
6 IRgbColor pColor = new RgbColorClass();
7 pColor.Green = 255;
8
9 double pSize = Math.Round(7200 / this.axMapControl1.MapScale, 2);
10 if (pSize < 1)
11 pSize = 1;
12 if (pSize > 20)
13 pSize = 20;
14
15 IMarkerElement pMarkerElement = new MarkerElementClass();
16 ISimpleMarkerSymbol pMarkerSymbol = new SimpleMarkerSymbolClass();
17 pMarkerSymbol.Color = pColor;
18 pMarkerSymbol.Angle = 0;
19 pMarkerSymbol.Size = pSize;
20 pMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
21
22 pMarkerElement.Symbol = pMarkerSymbol;
23 pElement = pMarkerElement as IElement;
24 pElement.Geometry = pPoint;
25
26 this.axMapControl1.ActiveView.GraphicsContainer.AddElement(pElement, 0);
27 this.axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, this.axMapControl1.ActiveView.Extent);
28
29 }
30 }