1

I have a problem you want help:

enter image description here

In ArcMap 10.2.2

enter image description here

In my code I want to highlight selections but I can't.

My code:

void drawPoint(IFeature pfeature) { IRgbColor rgbColor = new RgbColorClass(); rgbColor.Red = 255; rgbColor.Blue = 0; rgbColor.Green = 0; IMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol(); simpleMarkerSymbol.Color = rgbColor;// color RED simpleMarkerSymbol.Size = 15; IMarkerElement markerElement = null; markerElement = new MarkerElementClass(); markerElement.Symbol = simpleMarkerSymbol; IGraphicsContainer graphicsContainer = GeneralVariableMap.mapControl.Map as IGraphicsContainer; IElement element = null; element = (IElement)markerElement; element.Geometry = pfeature.Shape; graphicsContainer.AddElement(element, 0); } 
2

1 Answer 1

1

Maybe you only have to refresh the map. Don't know what is GeneralVariableMap. Usually I do sth like this:

mxDocument.ActivatedView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); 

Another idea (not tested):

void drawPoint(IFeature pfeature) { IRgbColor rgbColor = new RgbColorClass(); rgbColor.Red = 255; rgbColor.Blue = 0; rgbColor.Green = 0; IMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol(); simpleMarkerSymbol.Color = rgbColor;// color RED simpleMarkerSymbol.Size = 15; IElement element = new MarkerElementClass(); IMarkerElement markerElement =(IMarkerElement)element; markerElement.Symbol = simpleMarkerSymbol; IGraphicsContainer graphicsContainer = GeneralVariableMap.mapControl.Map as IGraphicsContainer; element.Geometry = pfeature.Shape; graphicsContainer.AddElement(element, 0); } 
1
  • It does't work! Commented Mar 24, 2016 at 1:22

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.