ArcEngine 画图

来源:互联网 发布:网络营销软件三尾狐 编辑:程序博客网 时间:2024/05/10 21:17

方法一:

[csharp] view plaincopyprint?在CODE上查看代码片派生到我的代码片
  1. private void DrawMapShape(IGeometry geometry)  
  2. {  
  3.     ISimpleFillSymbol simpleFillSymbol;  
  4.     simpleFillSymbol = new SimpleFillSymbolClass();  
  5.     simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSNull;  
  6.   
  7.     IRgbColor color = new RgbColorClass();  
  8.     color.Green = 137;  
  9.     color.Blue = 209;  
  10.     ILineSymbol line = new SimpleLineSymbolClass();  
  11.     line.Color = color;  
  12.     line.Width = 3;  
  13.     simpleFillSymbol.Outline = line;  
  14.     object symbol = simpleFillSymbol;  
  15.     base.m_pMapCtrl.DrawShape(geometry, ref symbol);  
  16. }  


方法二:

[csharp] view plaincopyprint?在CODE上查看代码片派生到我的代码片
  1. private void AddElement(IGeometry geometry)  
  2. {  
  3.     IPolygonElement polygonElement;  
  4.     polygonElement = new PolygonElementClass();  
  5.     IElement element;  
  6.     element = polygonElement as IElement;  
  7.     element.Geometry = geometry;  
  8.     IGraphicsContainer graphicsContainer = base.m_pMapCtrl.Map as IGraphicsContainer;  
  9.     graphicsContainer.AddElement((IElement)polygonElement, 0);  
  10.     base.m_pMapCtrl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, nullnull);  
  11. }  


方法三:

[csharp] view plaincopyprint?在CODE上查看代码片派生到我的代码片
  1. private void DrawEnvelope(IEnvelope newEnvelope)  
  2. {  
  3.     short cacheID = base.m_pMapCtrl.ActiveView.ScreenDisplay.AddCache();  
  4.   
  5.     ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass();  
  6.     IRgbColor rgbColor = new RgbColorClass();  
  7.     rgbColor.Red = 255;  
  8.     fillSymbol.Color = rgbColor;  
  9.   
  10.     base.m_pMapCtrl.ActiveView.ScreenDisplay.StartDrawing(base.m_pMapCtrl.ActiveView.ScreenDisplay.hDC, cacheID);  
  11.     base.m_pMapCtrl.ActiveView.ScreenDisplay.SetSymbol((ISymbol)fillSymbol);  
  12.     base.m_pMapCtrl.ActiveView.ScreenDisplay.DrawRectangle(newEnvelope);  
  13.     base.m_pMapCtrl.ActiveView.ScreenDisplay.FinishDrawing();  
  14. }  
0 0
原创粉丝点击