ArcEngine中闪烁目标

 
  1. //闪烁目标
  2.         public static void FlashFeature(AxMapControl mapControl,IFeature iFeature, IMap iMap)
  3.         {
  4.             IActiveView iActiveView = iMap as IActiveView;
  5.             if (iActiveView != null)
  6.             {
  7.                 iActiveView.ScreenDisplay.StartDrawing(0, (short)esriScreenCache.esriNoScreenCache);
  8.                 //根据几何类型调用不同的过程
  9.                 switch (iFeature.Shape.GeometryType)
  10.                 {
  11.                     case esriGeometryType.esriGeometryPolyline:
  12.                         FlashLine(mapControl, iActiveView.ScreenDisplay, iFeature.Shape);
  13.                         break;
  14.                     case esriGeometryType.esriGeometryPolygon:
  15.                         FlashPolygon(mapControl, iActiveView.ScreenDisplay, iFeature.Shape);
  16.                         break;
  17.                     case esriGeometryType.esriGeometryPoint:
  18.                         FlashPoint(mapControl, iActiveView.ScreenDisplay, iFeature.Shape);
  19.                         break;
  20.                     default:
  21.                         break;
  22.                 }
  23.                 iActiveView.ScreenDisplay.FinishDrawing();
  24.             }
  25.         }
  26.         //闪烁线
  27.         static void FlashLine(AxMapControl mapControl,IScreenDisplay iScreenDisplay,IGeometry iGeometry)
  28.         {
  29.             ISimpleLineSymbol iLineSymbol;
  30.             ISymbol iSymbol;
  31.             IRgbColor iRgbColor;
  32.             iLineSymbol = new SimpleLineSymbol();
  33.             iLineSymbol.Width = 4;
  34.             iRgbColor = new RgbColor();
  35.             iRgbColor.Red = 255;
  36.             iLineSymbol.Color = iRgbColor;
  37.             iSymbol = (ISymbol)iLineSymbol;
  38.             iSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
  39.             mapControl.FlashShape(iGeometry, 3, 200, iSymbol);
  40.         }
  41.         //闪烁面
  42.         static void FlashPolygon(AxMapControl mapControl, IScreenDisplay iScreenDisplay, IGeometry iGeometry)
  43.         {
  44.             ISimpleFillSymbol iFillSymbol;
  45.             ISymbol iSymbol;
  46.             IRgbColor iRgbColor;
  47.             iFillSymbol = new SimpleFillSymbol();
  48.             iFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid;
  49.             iFillSymbol.Outline.Width = 12;
  50.             iRgbColor = new RgbColor();
  51.             iRgbColor.RGB = System.Drawing.Color.FromArgb(100, 180, 180).ToArgb();
  52.             iFillSymbol.Color = iRgbColor;
  53.             iSymbol = (ISymbol)iFillSymbol;
  54.             iSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
  55.             iScreenDisplay.SetSymbol(iSymbol);
  56.             mapControl.FlashShape(iGeometry, 3, 200, iSymbol);
  57.         }
  58.         //闪烁点
  59.         static void FlashPoint(AxMapControl mapControl, IScreenDisplay iScreenDisplay, IGeometry iGeometry)
  60.         {
  61.             ISimpleMarkerSymbol iMarkerSymbol;
  62.             ISymbol iSymbol;
  63.             IRgbColor iRgbColor;
  64.             iMarkerSymbol = new SimpleMarkerSymbol();
  65.             iMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
  66.             iRgbColor = new RgbColor();
  67.             iRgbColor.RGB = System.Drawing.Color.FromArgb(0, 0, 0).ToArgb();
  68.             iMarkerSymbol.Color = iRgbColor;
  69.             iSymbol = (ISymbol)iMarkerSymbol;
  70.             iSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
  71.             mapControl.FlashShape(iGeometry, 3, 200, iSymbol);
  72.         } 

你可能感兴趣的:(ArcEngine中闪烁目标)