Beispiel #1
0
 private void method_1(IScreenDisplay iscreenDisplay_0, IGeometry igeometry_0)
 {
     try
     {
         ISimpleMarkerSymbol simpleMarkerSymbolClass = new SimpleMarkerSymbol()
         {
             Style = esriSimpleMarkerStyle.esriSMSCircle
         };
         (new RgbColor()).Green = 128;
         ISymbol symbol = (ISymbol)simpleMarkerSymbolClass;
         for (int i = 0; i < (igeometry_0 as IPointCollection).PointCount; i++)
         {
             iscreenDisplay_0.SetSymbol(symbol);
             iscreenDisplay_0.DrawPoint((igeometry_0 as IPointCollection).Point[i]);
         }
     }
     catch (Exception exception)
     {
         Logger.Current.Error("", exception, "");
     }
 }
Beispiel #2
0
 public static void DrawPolyline(IScreenDisplay pDisplay)
 {
     if (m_ipPolyline == null)
     {
         if ((m_ipEnumNetEID_Junctions != null) && (m_ipEnumNetEID_Junctions.Count == 1))
         {
             IEIDHelper helper = new EIDHelperClass
             {
                 GeometricNetwork = m_pAnalystGN,
                 ReturnGeometries = true
             };
             IEnumEIDInfo info = helper.CreateEnumEIDInfo(m_ipEnumNetEID_Junctions);
             info.Reset();
             IGeometry           point  = info.Next().Geometry;
             ISimpleMarkerSymbol symbol = new SimpleMarkerSymbolClass
             {
                 Style = esriSimpleMarkerStyle.esriSMSCircle,
                 Size  = 2.0,
                 Color = ColorManage.Red
             };
             pDisplay.StartDrawing(0, -1);
             pDisplay.SetSymbol(symbol as ISymbol);
             pDisplay.DrawPoint(point);
             pDisplay.FinishDrawing();
         }
     }
     else
     {
         ISimpleLineSymbol symbol2 = new SimpleLineSymbolClass
         {
             Style = esriSimpleLineStyle.esriSLSSolid,
             Width = 2.0,
             Color = ColorManage.Red
         };
         pDisplay.StartDrawing(0, -1);
         pDisplay.SetSymbol(symbol2 as ISymbol);
         pDisplay.DrawPolyline(m_ipPolyline);
         pDisplay.FinishDrawing();
     }
 }
Beispiel #3
0
 public override void Draw(IScreenDisplay display)
 {
     if (ShapeType == 0)
     {
         for (int i = 0; i < mGeometries.Count; i++)
         {
             RPoint pt = mGeometries[i] as RPoint;
             if (pt != null)
             {
                 display.DrawPoint(new Pen(Color.Red), pt);
             }
         }
     }
     if (ShapeType == 1)
     {
         for (int i = 0; i < mGeometries.Count; i++)
         {
             RPolyline pt = mGeometries[i] as RPolyline;
             if (pt != null)
             {
                 display.DrawPolyline(new Pen(Color.Red), pt);
             }
         }
     }
     if (ShapeType == 2)
     {
         for (int i = 0; i < mGeometries.Count; i++)
         {
             RPolygon pt = mGeometries[i] as RPolygon;
             if (pt != null)
             {
                 display.DrawPolygon(new Pen(Color.Red), pt);
             }
         }
     }
 }
        //��˸��������
        public static void FlashPoint(IScreenDisplay pDisplay, IGeometry pGeometry)
        {
            ISimpleMarkerSymbol pMarkerSymbol = new SimpleMarkerSymbolClass();
            pMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;

            IRgbColor pRgbColor = new RgbColorClass();
            pRgbColor.Red = 150;
            pRgbColor.Green = 100;
            pRgbColor.Blue = 100;
            pMarkerSymbol.Color = pRgbColor as IColor;
            pMarkerSymbol.Outline = true;
            ISymbol pSymbol = pMarkerSymbol as ISymbol;
            pSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            pDisplay.SetSymbol(pSymbol);
            pDisplay.DrawPoint(pGeometry);
            Thread.Sleep(300);
            pDisplay.DrawPoint(pGeometry);
        }
Beispiel #5
0
        public static void DrawWinkFeature(IScreenDisplay pDisplay, IGeometry pGeo)
        {
            IRgbColor rgbColorClass = new RgbColor()
            {
                Blue  = 0,
                Green = 0,
                Red   = 255,
            };
            short activeCache = pDisplay.ActiveCache;

            pDisplay.ActiveCache = -1;
            pDisplay.StartDrawing(pDisplay.hDC, -1);
            switch (pGeo.GeometryType)
            {
            case esriGeometryType.esriGeometryPoint:
            {
                ISimpleMarkerSymbol simpleMarkerSymbolClass = new SimpleMarkerSymbol();
                ((ISymbol)simpleMarkerSymbolClass).ROP2 = esriRasterOpCode.esriROPNotXOrPen;
                simpleMarkerSymbolClass.Color           = rgbColorClass;
                simpleMarkerSymbolClass.Size            = (double)9;
                pDisplay.SetSymbol((ISymbol)simpleMarkerSymbolClass);
                pDisplay.DrawPoint(pGeo);
                Thread.Sleep((int)1000);
                pDisplay.DrawPoint(pGeo);
                Thread.Sleep((int)1000);
                pDisplay.FinishDrawing();
                pDisplay.ActiveCache = activeCache;
                //mUiCurrentCounter = this;
                //mUiCurrentCounter.m_uiCurrentCounter = mUiCurrentCounter.m_uiCurrentCounter + 1;
                return;
            }

            case esriGeometryType.esriGeometryMultipoint:
            {
                pDisplay.FinishDrawing();
                pDisplay.ActiveCache = activeCache;
                //mUiCurrentCounter = this;
                //mUiCurrentCounter.m_uiCurrentCounter = mUiCurrentCounter.m_uiCurrentCounter + 1;
                return;
            }

            case esriGeometryType.esriGeometryPolyline:
            {
                ISimpleLineSymbol simpleLineSymbolClass = new SimpleLineSymbol();
                ((ISymbol)simpleLineSymbolClass).ROP2 = esriRasterOpCode.esriROPNotXOrPen;
                simpleLineSymbolClass.Color           = rgbColorClass;
                simpleLineSymbolClass.Width           = (double)3;
                pDisplay.SetSymbol((ISymbol)simpleLineSymbolClass);
                pDisplay.DrawPolyline(pGeo);
                Thread.Sleep((int)1000);
                pDisplay.DrawPolyline(pGeo);
                Thread.Sleep((int)1000);
                pDisplay.FinishDrawing();
                pDisplay.ActiveCache = activeCache;
                //mUiCurrentCounter = this;
                //mUiCurrentCounter.m_uiCurrentCounter = mUiCurrentCounter.m_uiCurrentCounter + 1;
                return;
            }

            case esriGeometryType.esriGeometryPolygon:
            {
                ISimpleFillSymbol simpleFillSymbolClass = new SimpleFillSymbol();
                ((ISymbol)simpleFillSymbolClass).ROP2 = esriRasterOpCode.esriROPNotXOrPen;
                simpleFillSymbolClass.Color           = rgbColorClass;
                pDisplay.SetSymbol((ISymbol)simpleFillSymbolClass);
                pDisplay.DrawPolygon(pGeo);
                Thread.Sleep((int)1000);
                pDisplay.DrawPolygon(pGeo);
                Thread.Sleep((int)1000);
                pDisplay.FinishDrawing();
                pDisplay.ActiveCache = activeCache;
                //mUiCurrentCounter = this;
                //mUiCurrentCounter.m_uiCurrentCounter = mUiCurrentCounter.m_uiCurrentCounter + 1;
                return;
            }

            default:
            {
                pDisplay.FinishDrawing();
                pDisplay.ActiveCache = activeCache;
                //mUiCurrentCounter = this;
                //mUiCurrentCounter.m_uiCurrentCounter = mUiCurrentCounter.m_uiCurrentCounter + 1;
                return;
            }
            }
        }
Beispiel #6
0
        private void drawgeometryXOR(IGeometry pGeometry)
        {
            if (pGeometry == null)//如果窗体关闭或者取消 就不绘制 xisheng 2011.06.28
            {
                return;
            }
            IScreenDisplay pScreenDisplay = m_pMapControl.ActiveView.ScreenDisplay;
            ISymbol        pSymbol        = null;
            //颜色对象
            IRgbColor pRGBColor = new RgbColorClass();

            pRGBColor.UseWindowsDithering = false;
            pRGBColor = getRGB(255, 0, 0);
            pRGBColor.Transparency = 255;
            try
            {
                switch (pGeometry.GeometryType.ToString())
                {
                case "esriGeometryPoint":    //点要素
                    ISimpleMarkerSymbol pMarkerSymbol = new SimpleMarkerSymbolClass();
                    pMarkerSymbol.Size  = 7.0;
                    pMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
                    pMarkerSymbol.Color = pRGBColor;
                    pSymbol             = (ISymbol)pMarkerSymbol;
                    pSymbol.ROP2        = esriRasterOpCode.esriROPCopyPen;
                    break;

                case "esriGeometryPolyline":    //线要素
                    ISimpleLineSymbol pPolyLineSymbol = new SimpleLineSymbolClass();
                    pPolyLineSymbol.Color = pRGBColor;
                    pPolyLineSymbol.Width = 2.5;
                    pPolyLineSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
                    pSymbol = (ISymbol)pPolyLineSymbol;
                    ///ZQ  20111117 modify
                    pSymbol.ROP2 = esriRasterOpCode.esriROPCopyPen;
                    break;

                case "esriGeometryPolygon":    //面要素
                    ISimpleFillSymbol pFillSymbol = new SimpleFillSymbolClass();
                    ISimpleLineSymbol pLineSymbol = new SimpleLineSymbolClass();

                    pSymbol      = (ISymbol)pFillSymbol;
                    pSymbol.ROP2 = esriRasterOpCode.esriROPCopyPen;
                    /// end
                    pLineSymbol.Color   = pRGBColor;
                    pLineSymbol.Width   = 1.5;
                    pLineSymbol.Style   = esriSimpleLineStyle.esriSLSSolid;
                    pFillSymbol.Outline = pLineSymbol;

                    pFillSymbol.Color = pRGBColor;
                    pFillSymbol.Style = esriSimpleFillStyle.esriSFSDiagonalCross;
                    break;
                }


                pScreenDisplay.StartDrawing(pScreenDisplay.hDC, (System.Int16)ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache);  //esriScreenCache.esriNoScreenCache -1
                pScreenDisplay.SetSymbol(pSymbol);
                switch (pGeometry.GeometryType.ToString())
                {
                case "esriGeometryPoint":    //点要素
                    pScreenDisplay.DrawPoint(pGeometry);
                    break;

                case "esriGeometryPolyline":    //线要素
                    pScreenDisplay.DrawPolyline(pGeometry);
                    break;

                case "esriGeometryPolygon":    //面要素
                    pScreenDisplay.DrawPolygon(pGeometry);
                    break;
                }
                pScreenDisplay.FinishDrawing();
            }
            catch
            { }
            finally
            {
                pSymbol   = null;
                pRGBColor = null;
            }
        }
Beispiel #7
0
        public void DrawDifferenceGeometry(IGeometry igeometry_0, IScreenDisplay iscreenDisplay_0)
        {
            IRgbColor rgbColorClass = new RgbColor()
            {
                Red = 255
            };

            iscreenDisplay_0.StartDrawing(iscreenDisplay_0.hDC, -1);
            switch (igeometry_0.GeometryType)
            {
            case esriGeometryType.esriGeometryPoint:
            {
                ISimpleMarkerSymbol simpleMarkerSymbolClass = new SimpleMarkerSymbol()
                {
                    Color = rgbColorClass,
                    Size  = 10
                };
                iscreenDisplay_0.SetSymbol(simpleMarkerSymbolClass as ISymbol);
                iscreenDisplay_0.DrawPoint(igeometry_0);
                iscreenDisplay_0.FinishDrawing();
                return;
            }

            case esriGeometryType.esriGeometryMultipoint:
            {
                iscreenDisplay_0.FinishDrawing();
                return;
            }

            case esriGeometryType.esriGeometryPolyline:
            {
                ISimpleLineSymbol simpleLineSymbolClass = new SimpleLineSymbol()
                {
                    Color = rgbColorClass,
                    Width = 2
                };
                iscreenDisplay_0.SetSymbol(simpleLineSymbolClass as ISymbol);
                iscreenDisplay_0.DrawPolyline(igeometry_0);
                iscreenDisplay_0.FinishDrawing();
                return;
            }

            case esriGeometryType.esriGeometryPolygon:
            {
                ISimpleFillSymbol simpleFillSymbolClass = new SimpleFillSymbol();
                simpleFillSymbolClass.Outline.Color = rgbColorClass;
                simpleFillSymbolClass.Outline.Width = 2;
                simpleFillSymbolClass.Style         = esriSimpleFillStyle.esriSFSForwardDiagonal;
                iscreenDisplay_0.SetSymbol(simpleFillSymbolClass as ISymbol);
                iscreenDisplay_0.DrawPolygon(igeometry_0);
                iscreenDisplay_0.FinishDrawing();
                return;
            }

            default:
            {
                iscreenDisplay_0.FinishDrawing();
                return;
            }
            }
        }
        public void FlashGeometry(IGeometry Geom, IScreenDisplay Display, IColor Color, int Size, int Interval)
        {
            if (Geom == null)
            return;
              short Cache = Display.ActiveCache;
              Display.ActiveCache = (short)esriScreenCache.esriNoScreenCache;
              Display.StartDrawing(0, Cache);

              if (Geom.GeometryType == esriGeometryType.esriGeometryLine || Geom.GeometryType == esriGeometryType.esriGeometryCircularArc)
              {
            ILineSymbol pSimpleLineSymbol = new SimpleLineSymbolClass();
            ISymbol pSymbol = (ISymbol)pSimpleLineSymbol;
            pSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; //erase itself when drawn twice
            pSimpleLineSymbol.Width = Size;
            pSimpleLineSymbol.Color = Color;
            Display.SetSymbol((ISymbol)pSimpleLineSymbol);
            ISegmentCollection pPath = new PathClass();
            pPath.AddSegment((ISegment)Geom);
            IGeometryCollection pPolyL = new PolylineClass();
            pPolyL.AddGeometry((IGeometry)pPath);
            Display.DrawPolyline((IGeometry)pPolyL);
            System.Threading.Thread.Sleep(Interval);
            Display.DrawPolyline((IGeometry)pPolyL);
               }
              else if (Geom.GeometryType == esriGeometryType.esriGeometryPolyline)
              {
            ILineSymbol pSimpleLineSymbol = new SimpleLineSymbolClass();
            ISymbol pSymbol = (ISymbol)pSimpleLineSymbol; //'QI
            pSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; //erase itself when drawn twice
            pSimpleLineSymbol.Width = Size;
            pSimpleLineSymbol.Color = Color;
            Display.SetSymbol((ISymbol)pSimpleLineSymbol);
            Display.DrawPolyline(Geom);
            System.Threading.Thread.Sleep(Interval);
            Display.DrawPolyline(Geom);
              }
              else if (Geom.GeometryType == esriGeometryType.esriGeometryPolygon)
              {
            ISimpleFillSymbol pSimpleFillSymbol = new SimpleFillSymbolClass();
            ISymbol pSymbol = (ISymbol)pSimpleFillSymbol;
            pSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; //erase itself when drawn twice
            pSimpleFillSymbol.Color = Color;
            Display.SetSymbol((ISymbol)pSimpleFillSymbol);
            Display.DrawPolygon(Geom);
            System.Threading.Thread.Sleep(Interval);
            Display.DrawPolygon(Geom);
              }
              else if (Geom.GeometryType == esriGeometryType.esriGeometryPoint)
              {
            ISimpleMarkerSymbol pSimpleMarkersymbol = new SimpleMarkerSymbolClass();
            ISymbol pSymbol = (ISymbol)pSimpleMarkersymbol;
            pSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            pSimpleMarkersymbol.Color = Color;
            pSimpleMarkersymbol.Size = Size;
            Display.SetSymbol((ISymbol)pSimpleMarkersymbol);
            Display.DrawPoint(Geom);
            System.Threading.Thread.Sleep(Interval);
            Display.DrawPoint(Geom);
              }
              Display.FinishDrawing();
              //reset the cache
              Display.ActiveCache = Cache;
        }
		/// <summary>
		/// Flash a point feature on the map
		/// <param name="pDisplay">The map screen</param>
		/// <param name="pGeometry">The geometry of the feature to be flashed</param>
		/// </summary>
		private void FlashPoint(IScreenDisplay pDisplay, IGeometry pGeometry)
		{
			// for a point, we only flash a simple circle
			ISimpleMarkerSymbol pMarkerSymbol = new SimpleMarkerSymbolClass();
			pMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;

			// Set up the Raster Op-Code to help the flash mechanism
			ISymbol pSymbol = pMarkerSymbol as ISymbol;
			pSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;

			// Flash the point
			//  Two calls are made to Draw.  Since the ROP2 setting is NotXOrPen, the first call
			//  draws the symbol with our new symbology and the second call redraws what was originally 
			//  in the place of the symbol
			pDisplay.SetSymbol(pSymbol);
			pDisplay.DrawPoint(pGeometry);
			System.Threading.Thread.Sleep(300);
			pDisplay.DrawPoint(pGeometry);
		}