private void FeatureSelectionSetCtrl_Load(object sender, EventArgs e) { if (!this.ifeatureSelection_0.SetSelectionSymbol) { if (this.ifeatureSelection_0.SelectionColor == null) { this.radioGroup1.SelectedIndex = 0; } else { this.radioGroup1.SelectedIndex = 2; } } else { this.radioGroup1.SelectedIndex = 1; } if (this.ifeatureSelection_0.SelectionSymbol == null) { ILineSymbol symbol = new SimpleLineSymbolClass { Width = 2.0, Color = ColorManage.CreatColor(0, 255, 255) }; this.btnSymbol.Style = symbol; } else { this.btnSymbol.Style = this.ifeatureSelection_0.SelectionSymbol; } this.method_3(this.colorEdit1, this.ifeatureSelection_0.SelectionColor); this.bool_1 = true; }
protected ITextSymbol FontStyle(double double_5, esriTextHorizontalAlignment esriTextHorizontalAlignment_0, esriTextVerticalAlignment esriTextVerticalAlignment_0) { return(new TextSymbolClass { Size = double_5, Color = ColorManage.CreatColor(0, 0, 0), HorizontalAlignment = esriTextHorizontalAlignment_0, VerticalAlignment = esriTextVerticalAlignment_0 }); }
/// <summary> /// 文字设置 /// </summary> /// <param name="txtEle"></param> /// <param name="size"></param> /// <param name="hAlignment"></param> /// <param name="vAligment"></param> protected ITextSymbol FontStyle(double size, esriTextHorizontalAlignment hAlignment, esriTextVerticalAlignment vAligment) { ITextSymbol textSymbolClass = new TextSymbol() { Size = size, Color = ColorManage.CreatColor(0, 0, 0), HorizontalAlignment = hAlignment, VerticalAlignment = vAligment }; return(textSymbolClass); }
private IEnumColors method_1(IColorRamp icolorRamp_1, int int_0) { if (icolorRamp_1 == null) { IAlgorithmicColorRamp ramp = new AlgorithmicColorRampClass { FromColor = ColorManage.CreatColor(160, 0, 0), ToColor = ColorManage.CreatColor(255, 200, 200), Algorithm = esriColorRampAlgorithm.esriLabLChAlgorithm }; icolorRamp_1 = ramp; } return(ColorManage.CreateColors(icolorRamp_1, int_0)); }
public override void OnDblClick() { if (this._polygonFeedback != null) { IPolygon polygon = this._polygonFeedback.Stop(); ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbol(); ISimpleFillSymbol arg_3E_0 = simpleFillSymbol; IRgbColor rgbColorClass = ColorManage.CreatColor(255, 0, 0) as IRgbColor; arg_3E_0.Color = rgbColorClass; if (polygon != null) { CommonUtils.NewPolygonElement(_context.FocusMap, polygon); } } int pointCount = this._pointCollection.PointCount; this._pointCollection.RemovePoints(0, pointCount); this._polygonFeedback = null; }
private void StartSection() { DMCoordForm dMCoordForm = new DMCoordForm() { pPolyline = _sectLine }; if (dMCoordForm.ShowDialog() == DialogResult.OK) { _sectLine = dMCoordForm.pPolyline; } ISimpleLineSymbol simpleLineSymbolClass = new SimpleLineSymbol(); IRgbColor rgbColorClass = ColorManage.CreatColor(255, 0, 0) as IRgbColor; simpleLineSymbolClass.Color = (rgbColorClass); simpleLineSymbolClass.Width = 2; if (_sectLine != null) { CommonUtils.NewLineElement(_context.FocusMap, _sectLine); double num = _sectLine.FromPoint.X; string str = num.ToString("f2"); num = _sectLine.FromPoint.Y; string str1 = string.Concat("X =", str, " Y=", num.ToString("f2")); IElement textElement = this.GetTextElement(0, str1, _sectLine.FromPoint); ((IGraphicsContainer)_context.ActiveView).AddElement(textElement, 0); num = _sectLine.ToPoint.X; string str2 = num.ToString("f2"); num = _sectLine.ToPoint.Y; str1 = string.Concat("X =", str2, " Y=", num.ToString("f2")); textElement = this.GetTextElement(0, str1, _sectLine.ToPoint); ((IGraphicsContainer)_context.ActiveView).AddElement(textElement, 0); this._lineFeedback = null; SectionViewFrm sectionViewFrm = new SectionViewFrm(SectionViewFrm.SectionType.SectionTypeTransect, _context, _plugin.PipeConfig); sectionViewFrm.PutBaseLine(_sectLine); sectionViewFrm.ShowDialog(); } }
public static void UsingRasterStretchColorRampRenderer(IRasterLayer irasterLayer_0) { bool flag; IRaster raster = irasterLayer_0.Raster; IRasterStretchColorRampRenderer renderer = new RasterStretchColorRampRenderer(); IRasterRenderer renderer2 = renderer as IRasterRenderer; renderer2.Raster = raster; renderer2.Update(); IColor color = ColorManage.CreatColor(255, 0, 0); IColor color2 = ColorManage.CreatColor(0, 255, 0); IAlgorithmicColorRamp ramp = new AlgorithmicColorRamp { Size = 255, FromColor = color, ToColor = color2 }; ramp.CreateRamp(out flag); renderer.BandIndex = 0; renderer.ColorRamp = ramp; renderer2.Update(); irasterLayer_0.Renderer = renderer as IRasterRenderer; }
private IFeatureRenderer method_6(ITopology itopology_0, esriTopologyRenderer esriTopologyRenderer_0) { IUniqueValueRenderer renderer = null; IList list; IFillSymbol symbol; ILineSymbol symbol2; bool flag; IEnumColors colors; IFillSymbol symbol3; int num; ITopologyRule rule; int topologyRuleType; ILineSymbol symbol4; ISimpleMarkerSymbol symbol5; ISimpleMarkerSymbol symbol6; IRandomColorRamp ramp = new RandomColorRampClass { StartHue = 40, EndHue = 120, MinValue = 65, MaxValue = 90, MinSaturation = 25, MaxSaturation = 45, Size = 5, Seed = 23 }; switch (esriTopologyRenderer_0) { case esriTopologyRenderer.esriTRAreaErrors: renderer = new UniqueValueRendererClass(); list = this.method_4(itopology_0); symbol = new SimpleFillSymbolClass { Color = ColorManage.CreatColor(255, 128, 128) }; symbol2 = new SimpleLineSymbolClass { Width = 2.5, Color = ColorManage.CreatColor(255, 0, 0) }; symbol.Outline = symbol2; renderer.DefaultSymbol = (symbol as IClone).Clone() as ISymbol; ramp.Size = list.Count + 2; ramp.CreateRamp(out flag); colors = ramp.Colors; colors.Reset(); symbol3 = (symbol as IClone).Clone() as IFillSymbol; symbol3.Color = colors.Next(); renderer.AddValue("0", "必须大于集束容限值", symbol3 as ISymbol); renderer.set_Label("0", "必须大于集束容限值"); for (num = 0; num < list.Count; num++) { rule = list[num] as ITopologyRule; symbol3 = (symbol as IClone).Clone() as IFillSymbol; symbol3.Color = colors.Next(); topologyRuleType = (int)rule.TopologyRuleType; renderer.AddValue(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType), symbol3 as ISymbol); renderer.set_Label(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType)); } break; case esriTopologyRenderer.esriTRLineErrors: renderer = new UniqueValueRendererClass(); list = this.method_3(itopology_0); symbol2 = new SimpleLineSymbolClass { Width = 2.5, Color = ColorManage.CreatColor(255, 128, 128) }; renderer.DefaultSymbol = (symbol2 as IClone).Clone() as ISymbol; ramp.Size = list.Count + 2; ramp.CreateRamp(out flag); colors = ramp.Colors; colors.Reset(); symbol4 = (symbol2 as IClone).Clone() as ILineSymbol; symbol4.Color = colors.Next(); renderer.AddValue("0", "必须大于集束容限值", symbol4 as ISymbol); renderer.set_Label("0", "必须大于集束容限值"); for (num = 0; num < list.Count; num++) { rule = list[num] as ITopologyRule; symbol4 = (symbol2 as IClone).Clone() as ILineSymbol; symbol4.Color = colors.Next(); topologyRuleType = (int)rule.TopologyRuleType; renderer.AddValue(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType), symbol4 as ISymbol); renderer.set_Label(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType)); } break; case esriTopologyRenderer.esriTRPointErrors: renderer = new UniqueValueRendererClass(); list = this.method_2(itopology_0); symbol5 = new SimpleMarkerSymbolClass { Size = 6.0, Style = esriSimpleMarkerStyle.esriSMSSquare, Color = ColorManage.CreatColor(255, 128, 128) }; renderer.DefaultSymbol = (symbol5 as IClone).Clone() as ISymbol; if (list.Count > 0) { ramp.Size = list.Count + 1; ramp.CreateRamp(out flag); colors = ramp.Colors; colors.Reset(); symbol6 = null; for (num = 0; num < list.Count; num++) { rule = list[num] as ITopologyRule; symbol6 = (symbol5 as IClone).Clone() as ISimpleMarkerSymbol; symbol6.Color = colors.Next(); topologyRuleType = (int)rule.TopologyRuleType; renderer.AddValue(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType), symbol6 as ISymbol); renderer.set_Label(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType)); } } break; case esriTopologyRenderer.esriTRAreaExceptions: renderer = new UniqueValueRendererClass(); list = this.method_4(itopology_0); symbol = new SimpleFillSymbolClass { Color = ColorManage.CreatColor(255, 255, 255) }; symbol2 = new SimpleLineSymbolClass { Width = 1.0, Color = ColorManage.CreatColor(128, 255, 128) }; symbol.Outline = symbol2; renderer.DefaultSymbol = (symbol as IClone).Clone() as ISymbol; ramp.Size = list.Count + 2; ramp.CreateRamp(out flag); colors = ramp.Colors; colors.Reset(); symbol3 = (symbol as IClone).Clone() as IFillSymbol; symbol3.Color = colors.Next(); renderer.AddValue("0", "必须大于集束容限值", symbol3 as ISymbol); renderer.set_Label("0", "必须大于集束容限值"); for (num = 0; num < list.Count; num++) { rule = list[num] as ITopologyRule; symbol3 = (symbol as IClone).Clone() as IFillSymbol; symbol3.Color = colors.Next(); topologyRuleType = (int)rule.TopologyRuleType; renderer.AddValue(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType), symbol3 as ISymbol); renderer.set_Label(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType)); } break; case esriTopologyRenderer.esriTRLineExceptions: renderer = new UniqueValueRendererClass(); list = this.method_3(itopology_0); symbol2 = new SimpleLineSymbolClass { Width = 1.0, Color = ColorManage.CreatColor(128, 255, 128) }; renderer.DefaultSymbol = (symbol2 as IClone).Clone() as ISymbol; ramp.Size = list.Count + 2; ramp.CreateRamp(out flag); colors = ramp.Colors; colors.Reset(); symbol4 = (symbol2 as IClone).Clone() as ILineSymbol; symbol4.Color = colors.Next(); renderer.AddValue("0", "必须大于集束容限值", symbol4 as ISymbol); renderer.set_Label("0", "必须大于集束容限值"); for (num = 0; num < list.Count; num++) { rule = list[num] as ITopologyRule; symbol4 = (symbol2 as IClone).Clone() as ILineSymbol; symbol4.Color = colors.Next(); topologyRuleType = (int)rule.TopologyRuleType; renderer.AddValue(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType), symbol4 as ISymbol); renderer.set_Label(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType)); } break; case esriTopologyRenderer.esriTRPointExceptions: renderer = new UniqueValueRendererClass(); list = this.method_2(itopology_0); symbol5 = new SimpleMarkerSymbolClass { Size = 5.0, Style = esriSimpleMarkerStyle.esriSMSSquare, Color = ColorManage.CreatColor(128, 255, 128) }; renderer.DefaultSymbol = (symbol5 as IClone).Clone() as ISymbol; if (list.Count > 0) { ramp.Size = list.Count + 1; ramp.CreateRamp(out flag); colors = ramp.Colors; colors.Reset(); symbol6 = null; for (num = 0; num < list.Count; num++) { rule = list[num] as ITopologyRule; symbol6 = (symbol5 as IClone).Clone() as ISimpleMarkerSymbol; symbol6.Color = colors.Next(); topologyRuleType = (int)rule.TopologyRuleType; renderer.AddValue(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType), symbol6 as ISymbol); renderer.set_Label(topologyRuleType.ToString(), this.method_5(rule.TopologyRuleType)); } } break; } return(renderer as IFeatureRenderer); }
private IFeatureRenderer method_1(esriTopologyRenderer esriTopologyRenderer_0) { IFeatureRenderer renderer = null; IFillSymbol symbol; ILineSymbol symbol2; ISimpleMarkerSymbol symbol3; switch (esriTopologyRenderer_0) { case esriTopologyRenderer.esriTRAreaErrors: renderer = new SimpleRendererClass(); symbol = new SimpleFillSymbolClass { Color = ColorManage.CreatColor(255, 128, 128) }; symbol2 = new SimpleLineSymbolClass { Width = 2.5, Color = ColorManage.CreatColor(255, 0, 0) }; symbol.Outline = symbol2; (renderer as ISimpleRenderer).Symbol = symbol as ISymbol; return(renderer); case esriTopologyRenderer.esriTRLineErrors: renderer = new SimpleRendererClass(); symbol2 = new SimpleLineSymbolClass { Width = 2.5, Color = ColorManage.CreatColor(255, 128, 128) }; (renderer as ISimpleRenderer).Symbol = symbol2 as ISymbol; return(renderer); case esriTopologyRenderer.esriTRPointErrors: renderer = new SimpleRendererClass(); symbol3 = new SimpleMarkerSymbolClass { Size = 6.0, Style = esriSimpleMarkerStyle.esriSMSSquare, Color = ColorManage.CreatColor(255, 128, 128) }; (renderer as ISimpleRenderer).Symbol = symbol3 as ISymbol; return(renderer); case esriTopologyRenderer.esriTRAreaExceptions: renderer = new SimpleRendererClass(); symbol = new SimpleFillSymbolClass { Color = ColorManage.CreatColor(255, 255, 255) }; symbol2 = new SimpleLineSymbolClass { Width = 1.0, Color = ColorManage.CreatColor(128, 255, 128) }; symbol.Outline = symbol2; (renderer as ISimpleRenderer).Symbol = symbol as ISymbol; return(renderer); case esriTopologyRenderer.esriTRLineExceptions: renderer = new SimpleRendererClass(); symbol2 = new SimpleLineSymbolClass { Width = 1.0, Color = ColorManage.CreatColor(128, 255, 128) }; (renderer as ISimpleRenderer).Symbol = symbol2 as ISymbol; return(renderer); case esriTopologyRenderer.esriTRPointExceptions: renderer = new SimpleRendererClass(); symbol3 = new SimpleMarkerSymbolClass { Size = 5.0, Style = esriSimpleMarkerStyle.esriSMSSquare, Color = ColorManage.CreatColor(128, 255, 128) }; (renderer as ISimpleRenderer).Symbol = symbol3 as ISymbol; return(renderer); case esriTopologyRenderer.esriTRDirtyAreas: renderer = new SimpleRendererClass(); symbol = new SimpleFillSymbolClass(); (symbol as ISimpleFillSymbol).Style = esriSimpleFillStyle.esriSFSForwardDiagonal; symbol.Color = ColorManage.CreatColor(128, 128, 255); symbol2 = new SimpleLineSymbolClass { Width = 1.0, Color = ColorManage.CreatColor(128, 128, 255) }; symbol.Outline = symbol2; (renderer as ISimpleRenderer).Symbol = symbol as ISymbol; return(renderer); } return(renderer); }
private void method_0() { IFeatureRenderer pInObject = null; IFillSymbol symbol; ILineSymbol symbol2; IObjectCopy copy; ISimpleMarkerSymbol symbol3; pInObject = this.itopologyLayer_0.get_Renderer(esriTopologyRenderer.esriTRAreaErrors); this.chkListRender.Items.Add("面错误", pInObject != null); if (pInObject == null) { pInObject = new SimpleRendererClass(); symbol = new SimpleFillSymbolClass { Color = ColorManage.CreatColor(255, 128, 128) }; symbol2 = new SimpleLineSymbolClass { Width = 2.5, Color = ColorManage.CreatColor(255, 0, 0) }; symbol.Outline = symbol2; (pInObject as ISimpleRenderer).Symbol = symbol as ISymbol; } else { copy = new ObjectCopyClass(); pInObject = copy.Copy(pInObject) as IFeatureRenderer; } if (pInObject is ISimpleRenderer) { this.ilist_1.Add(pInObject); this.ilist_2.Add(this.method_6(this.itopologyLayer_0.Topology, esriTopologyRenderer.esriTRAreaErrors)); } else { this.ilist_1.Add(this.method_1(esriTopologyRenderer.esriTRAreaErrors)); this.ilist_2.Add(pInObject); } this.ilist_0.Add(pInObject); pInObject = this.itopologyLayer_0.get_Renderer(esriTopologyRenderer.esriTRLineErrors); this.chkListRender.Items.Add("线错误", pInObject != null); if (pInObject == null) { pInObject = new SimpleRendererClass(); symbol2 = new SimpleLineSymbolClass { Width = 2.5, Color = ColorManage.CreatColor(255, 128, 128) }; (pInObject as ISimpleRenderer).Symbol = symbol2 as ISymbol; } else { copy = new ObjectCopyClass(); pInObject = copy.Copy(pInObject) as IFeatureRenderer; } if (pInObject is ISimpleRenderer) { this.ilist_1.Add(pInObject); this.ilist_2.Add(this.method_6(this.itopologyLayer_0.Topology, esriTopologyRenderer.esriTRLineErrors)); } else { this.ilist_1.Add(this.method_1(esriTopologyRenderer.esriTRLineErrors)); this.ilist_2.Add(pInObject); } this.ilist_0.Add(pInObject); pInObject = this.itopologyLayer_0.get_Renderer(esriTopologyRenderer.esriTRPointErrors); this.chkListRender.Items.Add("点错误", pInObject != null); if (pInObject == null) { pInObject = new SimpleRendererClass(); symbol3 = new SimpleMarkerSymbolClass { Size = 6.0, Style = esriSimpleMarkerStyle.esriSMSSquare, Color = ColorManage.CreatColor(255, 128, 128) }; (pInObject as ISimpleRenderer).Symbol = symbol3 as ISymbol; } else { copy = new ObjectCopyClass(); pInObject = copy.Copy(pInObject) as IFeatureRenderer; } if (pInObject is ISimpleRenderer) { this.ilist_1.Add(pInObject); this.ilist_2.Add(this.method_6(this.itopologyLayer_0.Topology, esriTopologyRenderer.esriTRPointErrors)); } else { this.ilist_1.Add(this.method_1(esriTopologyRenderer.esriTRPointErrors)); this.ilist_2.Add(pInObject); } this.ilist_0.Add(pInObject); pInObject = this.itopologyLayer_0.get_Renderer(esriTopologyRenderer.esriTRAreaExceptions); this.chkListRender.Items.Add("面例外", pInObject != null); if (pInObject == null) { pInObject = new SimpleRendererClass(); symbol = new SimpleFillSymbolClass { Color = ColorManage.CreatColor(255, 255, 255) }; symbol2 = new SimpleLineSymbolClass { Width = 1.0, Color = ColorManage.CreatColor(128, 255, 128) }; symbol.Outline = symbol2; (pInObject as ISimpleRenderer).Symbol = symbol as ISymbol; } else { copy = new ObjectCopyClass(); pInObject = copy.Copy(pInObject) as IFeatureRenderer; } if (pInObject is ISimpleRenderer) { this.ilist_1.Add(pInObject); this.ilist_2.Add(this.method_6(this.itopologyLayer_0.Topology, esriTopologyRenderer.esriTRAreaExceptions)); } else { this.ilist_1.Add(this.method_1(esriTopologyRenderer.esriTRAreaExceptions)); this.ilist_2.Add(pInObject); } this.ilist_0.Add(pInObject); pInObject = this.itopologyLayer_0.get_Renderer(esriTopologyRenderer.esriTRLineExceptions); this.chkListRender.Items.Add("线例外", pInObject != null); if (pInObject == null) { pInObject = new SimpleRendererClass(); symbol2 = new SimpleLineSymbolClass { Width = 1.0, Color = ColorManage.CreatColor(128, 255, 128) }; (pInObject as ISimpleRenderer).Symbol = symbol2 as ISymbol; } else { copy = new ObjectCopyClass(); pInObject = copy.Copy(pInObject) as IFeatureRenderer; } if (pInObject is ISimpleRenderer) { this.ilist_1.Add(pInObject); this.ilist_2.Add(this.method_6(this.itopologyLayer_0.Topology, esriTopologyRenderer.esriTRLineExceptions)); } else { this.ilist_1.Add(this.method_1(esriTopologyRenderer.esriTRLineExceptions)); this.ilist_2.Add(pInObject); } this.ilist_0.Add(pInObject); pInObject = this.itopologyLayer_0.get_Renderer(esriTopologyRenderer.esriTRPointExceptions); this.chkListRender.Items.Add("点例外", pInObject != null); if (pInObject == null) { pInObject = new SimpleRendererClass(); symbol3 = new SimpleMarkerSymbolClass { Size = 5.0, Style = esriSimpleMarkerStyle.esriSMSSquare, Color = ColorManage.CreatColor(128, 255, 128) }; (pInObject as ISimpleRenderer).Symbol = symbol3 as ISymbol; } else { copy = new ObjectCopyClass(); pInObject = copy.Copy(pInObject) as IFeatureRenderer; } if (pInObject is ISimpleRenderer) { this.ilist_1.Add(pInObject); this.ilist_2.Add(this.method_6(this.itopologyLayer_0.Topology, esriTopologyRenderer.esriTRPointExceptions)); } else { this.ilist_1.Add(this.method_1(esriTopologyRenderer.esriTRPointExceptions)); this.ilist_2.Add(pInObject); } this.ilist_0.Add(pInObject); pInObject = this.itopologyLayer_0.get_Renderer(esriTopologyRenderer.esriTRDirtyAreas); this.chkListRender.Items.Add("脏区", pInObject != null); if (pInObject == null) { pInObject = new SimpleRendererClass(); symbol = new SimpleFillSymbolClass(); (symbol as ISimpleFillSymbol).Style = esriSimpleFillStyle.esriSFSForwardDiagonal; symbol.Color = ColorManage.CreatColor(128, 128, 255); symbol2 = new SimpleLineSymbolClass { Width = 1.0, Color = ColorManage.CreatColor(128, 128, 255) }; symbol.Outline = symbol2; (pInObject as ISimpleRenderer).Symbol = symbol as ISymbol; } else { copy = new ObjectCopyClass(); pInObject = copy.Copy(pInObject) as IFeatureRenderer; } if (pInObject is ISimpleRenderer) { this.ilist_1.Add(pInObject); this.ilist_2.Add(this.method_6(this.itopologyLayer_0.Topology, esriTopologyRenderer.esriTRDirtyAreas)); } else { this.ilist_1.Add(this.method_1(esriTopologyRenderer.esriTRDirtyAreas)); this.ilist_2.Add(pInObject); } this.ilist_0.Add(pInObject); }