AE实现矢量数据的基本操作

it2024-07-14  42

using ESRI.ArcGIS.Carto; using ESRI.ArcGIS.Controls; using ESRI.ArcGIS.Display; //矢量点层简单渲染 private void button1_Click(object sender, EventArgs e) { IFeatureLayer myfealyer = axMapControl1.get_Layer(0) as IFeatureLayer; IGeoFeatureLayer geofeature = myfealyer as IGeoFeatureLayer; ISimpleRenderer render =new SimpleRendererClass(); ISymbol sybol = new SimpleMarkerSymbolClass(); ISimpleMarkerSymbol marksybol = sybol as ISimpleMarkerSymbol; IColor colr = new RgbColorClass(); colr.RGB = 255; marksybol.Color = colr; marksybol.Size = 10; render.Symbol = sybol; geofeature.Renderer = render as IFeatureRenderer; axTOCControl1.Update(); axMapControl1.Refresh(); } //线程渲染 private void button2_Click(object sender, EventArgs e) { IFeatureLayer myfeaure = axMapControl1.get_Layer(0) as IFeatureLayer; IGeoFeatureLayer geofeature = myfeaure as IGeoFeatureLayer; ISimpleRenderer render = new SimpleRendererClass(); ISymbol sybol = new SimpleLineSymbolClass(); ISimpleLineSymbol linesybol = sybol as ISimpleLineSymbol; IColor colr = new RgbColorClass(); colr.RGB = 255; linesybol.Color = colr; linesybol.Width = 3; linesybol.Style =esriSimpleLineStyle.esriSLSSolid;//实线 render.Symbol = sybol; geofeature.Renderer = render as IFeatureRenderer; axTOCControl1.Update(); axMapControl1.Refresh(); } //面层的渲染 private void button3_Click(object sender, EventArgs e) { IFeatureLayer myfealyer = axMapControl1.get_Layer(0) as IFeatureLayer; IGeoFeatureLayer geofeature = myfealyer as IGeoFeatureLayer; ISimpleRenderer render = new SimpleRendererClass(); ILineSymbol sybol = new SimpleLineSymbolClass(); IColor colr = new RgbColorClass(); colr.RGB = 255; sybol.Color = colr; sybol.Width = 2; ISymbol fisbol = new SimpleFillSymbolClass(); ISimpleFillSymbol fillsybol = fisbol as ISimpleFillSymbol; IColor colr1 = new RgbColorClass(); colr1.RGB = 25; fillsybol.Color = colr1; fillsybol.Outline = sybol; fillsybol.Style = esriSimpleFillStyle.esriSFSHollow; render.Symbol = fisbol; geofeature.Renderer = render as IFeatureRenderer; axTOCControl1.Update(); axMapControl1.Refresh(); } } }
最新回复(0)