在地图上显示符号(个人总结)

最近开始接触有关网络分析的项目,想在图层中添加起终点,原先显示都是默认的小圆点,后来查阅了一些资料,可以做些改变,用些符号库里的符号,记录一下以免日后忘记,代码如下:

private void axMapControl1_OnDoubleClick(object sender, IMapControlEvents2_OnDoubleClickEvent e){
        ISimpleMarkerSymbol iMarkerSymbol;
	ISymbol iSymbol;
	IRgbColor iRgbColor;
	iMarkerSymbol = new SimpleMarkerSymbol();
	iMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSSquare;
	iRgbColor = new RgbColor();
	iRgbColor = getRGB(0, 0, 255);
	iMarkerSymbol.Color = iRgbColor;
	iMarkerSymbol.Size = 12;
	iSymbol = (ISymbol)iMarkerSymbol;
	iSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
	IPoint pPointEnd = axMapControl1.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(e.x, e.y);
	IActiveView activeView = this.axMapControl1.ActiveView;
	activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
	activeView.ScreenDisplay.SetSymbol(iSymbol);
	activeView.ScreenDisplay.DrawPoint(pPointEnd as IGeometry);
	activeView.ScreenDisplay.FinishDrawing();
	activeView.ScreenDisplay.FinishDrawing();
}
 
  
 
  
 
  
 
  
 
  
 
 

你可能感兴趣的:(在地图上显示符号(个人总结))