需要提前得到一个IActiveview类型的变量activeView
1、点绘制代码 其中getoffDrawList装载的是IFeature类型的点要素
1 if (getoffDrawList != null && getoffDrawList.Count > 0 ) 2 { 3 IRgbColor getOnOffPtcolor = new RgbColorClass(); 4 getOnOffPtcolor.Red = 0; 5 getOnOffPtcolor.Green = 0; 6 getOnOffPtcolor.Blue = 255; 7 8 ISimpleMarkerSymbol simpleMarkerSym = new SimpleMarkerSymbolClass(); 9 simpleMarkerSym.Size = 4; 10 simpleMarkerSym.Color = getOnOffPtcolor as IColor; 11 activeView.ScreenDisplay.SetSymbol(simpleMarkerSym as ISymbol); 12 foreach (IFeature getoffFea in getoffDrawList) 13 { 14 activeView.ScreenDisplay.DrawPoint(getoffFea.Shape as IPoint); 15 } 16 }
2、点绘制代码
1 if (emptyPathStrDrawList != null && emptyPathStrDrawList.Count > 0) 2 { 3 IRgbColor emptyPathColor = new RgbColorClass(); 4 emptyPathColor.Red = 255; 5 emptyPathColor.Green = 0; 6 emptyPathColor.Blue = 0; 7 8 ISimpleLineSymbol simpleLineSym = new SimpleLineSymbolClass(); 9 simpleLineSym.Color = emptyPathColor as IColor; 10 simpleLineSym.Width = 3; 11 12 activeView.ScreenDisplay.SetSymbol(simpleLineSym as ISymbol); 13 14 for (int i = 0; i < emptyPathStrDrawList.Count; i++) 15 { 16 IPolyline emptyLine = emptyPathStrDrawList[i].emptyPathLine; 17 activeView.ScreenDisplay.DrawPolyline(emptyLine); 18 } 19 }
3、面绘制代码
1 if (drawPolygonList != null && drawPolygonList.Count > 0) 2 { 3 IRgbColor color = new RgbColorClass(); 4 color.Red = 255; 5 color.Green = 0; 6 color.Blue = 0; 7 8 ISimpleLineSymbol lineSymbol = new SimpleLineSymbolClass(); 9 lineSymbol.Style = esriSimpleLineStyle.esriSLSSolid; 10 lineSymbol.Width = 1.0; 11 lineSymbol.Color = color; 12 13 ISimpleFillSymbol m_fillSymbol = new SimpleFillSymbolClass(); 14 m_fillSymbol.Color = color; 15 m_fillSymbol.Style = esriSimpleFillStyle.esriSFSNull;//.esriSFSNull空心多边形//.esriSFSSolid实心多边形 16 m_fillSymbol.Outline = (ILineSymbol)lineSymbol; 17 18 activeView.ScreenDisplay.SetSymbol(m_fillSymbol as ISymbol); 19 20 foreach (IPolygon polygon in drawPolygonList) 21 { 22 activeView.ScreenDisplay.DrawPolygon(polygon); 23 } 24 }
时间: 2024-11-03 11:35:02