I'm writing a C# add-in and trying to implement a piece where a user can add points to a graphics layer on the map view. The points are drawing, however the map pane has serious ghosting issues and I lose the ability to scroll zoom in and out. I assume the problem is in the way I am refreshing the display. Any input would be great. Thanks,
protected override void OnMouseDown(MouseEventArgs arg)
{
base.OnMouseDown(arg);
IGeometry pointcreate = drawPoint(ArcMap.Document.ActiveView, arg.X, arg.Y); //This creates the point but does not actually place it on screen
IRgbColor newColor = new RgbColorClass();
newColor.Red = 128;
IMap thisMap = getMap(ArcMap.Application);
addGraphicToMap(thisMap, pointcreate, newColor,newColor); //this actually places the graphic on screen.
IPoint newPoint = ScrCoordToMapCoord(arg.X, arg.Y, ArcMap.Document.ActiveView);
ArcMap.Document.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); //This is the refresh in question, I think.
}