/// <summary> /// Handles the EditValueChanged event of the cmbMarkerAngel control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void cmbMarkerAngel_EditValueChanged(object sender, EventArgs e) { if (this._styleGalleryItem.Item != null) { this._markerSymble = (this._styleGalleryItem.Item as IMarkerSymbol); this._markerSymble.Angle = Convert.ToDouble(this.cmbMarkerAngel.Value); this.ViewSymble(); } }
private void btnSelectSymbol_Click(object sender, EventArgs e) { ISymbol symbol = GetSymbolBySymbolSelector(esriGeometryType.esriGeometryPoint); if (symbol != null) { markerSymbol = symbol as IMarkerSymbol; } }
private void method_2(IMarkerSymbol imarkerSymbol_0, Rectangle rectangle_0) { IPoint geometry = new PointClass { X = (rectangle_0.Left + rectangle_0.Right) / 2, Y = (rectangle_0.Bottom + rectangle_0.Top) / 2 }; ((ISymbol)imarkerSymbol_0).Draw(geometry); }
/// <summary> /// Handles the EditValueChanged event of the cmbMarkerSize control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void cmbMarkerSize_EditValueChanged(object sender, EventArgs e) { if (this._styleGalleryItem.Item != null) { double size = Convert.ToDouble(cmbMarkerSize.Value); this._markerSymble = (this._styleGalleryItem.Item as IMarkerSymbol); this._markerSymble.Size = size; this.ViewSymble(); } }
private void DrawSymbol(IMarkerSymbol pSymbol, Rectangle rect) { IPoint geometry = new PointClass { X = (rect.Left + rect.Right) / 2, Y = (rect.Bottom + rect.Top) / 2 }; ((ISymbol)pSymbol).Draw(geometry); }
private void method_2(IMarkerSymbol imarkerSymbol_0, Rectangle rectangle_0) { IPoint pointClass = new PointClass() { X = (double)((rectangle_0.Left + rectangle_0.Right) / 2), Y = (double)((rectangle_0.Bottom + rectangle_0.Top) / 2) }; ((ISymbol)imarkerSymbol_0).Draw(pointClass); }
public ChartRender(AxMapControl pMapcontrol, IFeatureLayer pFtLayer, string pFieldName) { IGeoFeatureLayer pGeoFeaturelayer = pFtLayer as IGeoFeatureLayer; IChartRenderer pChart = new ChartRendererClass(); IDataStatistics pDataStat = new DataStatisticsClass(); IFeatureCursor pFtCursor = pFtLayer.FeatureClass.Search(null, false); pDataStat.Cursor = pFtCursor as ICursor; pDataStat.Field = pFieldName; double pMax = pDataStat.Statistics.Maximum; IRendererFields pRenderFields = pChart as IRendererFields; pRenderFields.AddField(pFieldName, pFieldName); IBarChartSymbol pBarChart = new BarChartSymbolClass(); pBarChart.Width = 5; IMarkerSymbol pMarkerSymbol = pBarChart as IMarkerSymbol; pMarkerSymbol.Size = 12; IChartSymbol pChartSym = pBarChart as IChartSymbol; pChartSym.MaxValue = pMax; ISymbolArray pSymbolArr = pBarChart as ISymbolArray; IFillSymbol pFillSy = new SimpleFillSymbolClass(); pFillSy.Color = GetRgb(220, 0, 0); pSymbolArr.AddSymbol(pFillSy as ISymbol); pGeoFeaturelayer.Renderer = pChart as IFeatureRenderer; pMapcontrol.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null); }
/// <summary> /// 获取指定要素的符号 /// </summary> /// <param name="pFeature"></param> /// <returns></returns> public static IMarkerSymbol GetMarkSymbol(IFeature pFeature) { IFeatureClass pfClass = pFeature.Class as IFeatureClass; IGeoFeatureLayer pGeofLayer = GeoDbUtils.GetFeatureLayer(pfClass.AliasName, true) as IGeoFeatureLayer; //IGeoFeatureLayer pGeofLayer = pLayer as IGeoFeatureLayer; IFeatureRenderer pFRenderer = pGeofLayer.Renderer; ISymbol pSymbol = pFRenderer.get_SymbolByFeature(pFeature); IMarkerSymbol pMarkerSymbol = pSymbol as IMarkerSymbol; return(pMarkerSymbol); }
/// <summary> /// BarChartRenderer柱状图渲染:根据一个或多个数字字段的值配置柱状图渲染图层 /// </summary> /// <param name="geoFeatureLayer"></param> /// <param name="fieldNameColorDict"></param> public static void SetBarCharRenderer(this IGeoFeatureLayer geoFeatureLayer, Dictionary <string, IColor> fieldNameColorDict) { //创建柱状符号 IBarChartSymbol barChartSymbol = new BarChartSymbolClass { Width = 12 }; //获取两个字段的最大值,设置柱状图各柱状符号 double maxValue = 0; ISymbolArray symbolArray = (ISymbolArray)barChartSymbol; foreach (var pair in fieldNameColorDict) { var value = geoFeatureLayer.FeatureClass.Statistics(pair.Key, null, EStatisticsType.Maximum); if (value > maxValue) { maxValue = value; } IFillSymbol fillSymbol = new SimpleFillSymbol { Color = pair.Value }; symbolArray.AddSymbol((ISymbol)fillSymbol); } //设置ChartSymbol的最大值,以及符号尺寸最大值(像素单位) IChartSymbol chartSymbol = (IChartSymbol)barChartSymbol; IMarkerSymbol markerSymbol = (IMarkerSymbol)barChartSymbol; chartSymbol.MaxValue = maxValue; markerSymbol.Size = 60; //设置字段,依据字段的数据值,创建柱状图 IChartRenderer chartRenderer = new ChartRendererClass(); IRendererFields rendererFields = (IRendererFields)chartRenderer; foreach (var pair in fieldNameColorDict) { rendererFields.AddField(pair.Key, pair.Key); } //设置图层的背景颜色 chartRenderer.ChartSymbol = (IChartSymbol)barChartSymbol; chartRenderer.BaseSymbol = new SimpleFillSymbolClass { Color = ColorCreate.GetIColor(239, 228, 190) }; //设置其他属性 chartRenderer.UseOverposter = false; chartRenderer.CreateLegend();//创建符号图例 chartRenderer.Label = ""; geoFeatureLayer.Renderer = chartRenderer as IFeatureRenderer; }
private void colorEdit1_EditValueChanged(object sender, EventArgs e) { if (this.bool_0) { IMarkerSymbol symbol = this.symbolItem1.Symbol as IMarkerSymbol; IColor color = symbol.Color; this.method_4(this.colorEdit1, color); symbol.Color = color; this.bool_1 = true; this.method_5(e); } }
private void PointAngle_ValueChanged(object sender, EventArgs e) { if (pStyleGalleryItem == null) { MessageBox.Show("请选择点样式", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } IMarkerSymbol pMarkerSymbol = pStyleGalleryItem.Item as IMarkerSymbol; pMarkerSymbol.Angle = PointAngle.Value; PreviewImage(); }
//箭头样式选择 private void btArrowSymbol_Click(object sender, EventArgs e) { IGraphicProperties m_GraphicProperties = new CommandsEnvironmentClass(); FrmSymbol FrmMarker = new FrmSymbol(SymbolStyle, (ISymbol)m_GraphicProperties.MarkerSymbol, esriSymbologyStyleClass.esriStyleClassMarkerSymbols); FrmMarker.ShowDialog(); if (FrmMarker.DialogResult == DialogResult.OK) { pArrowSymbol = FrmMarker.GetStyleGalleryItem() as IMarkerSymbol; } }
private void btnSelectSymbol_Click(object sender, EventArgs e) { GetSymbolByControl markerSymbolForm = new GetSymbolByControl(esriSymbologyStyleClass.esriStyleClassMarkerSymbols); markerSymbolForm.ShowDialog(); if (markerSymbolForm.m_styleGalleryItem == null) { return; } markerSymbol = markerSymbolForm.m_styleGalleryItem.Item as IMarkerSymbol; markerSymbolForm.Dispose(); }
private bool method_2(IElement ielement_1, out ICallout icallout_0) { icallout_0 = null; try { if (ielement_1 is ITextElement) { ITextElement element = ielement_1 as ITextElement; ITextSymbol symbol = element.Symbol; if (!(symbol is IFormattedTextSymbol)) { return(false); } IFormattedTextSymbol symbol2 = symbol as IFormattedTextSymbol; ITextBackground background = symbol2.Background; if (background == null) { return(false); } if (!(background is ICallout)) { return(false); } icallout_0 = background as ICallout; return(true); } if (ielement_1 is IMarkerElement) { IMarkerElement element2 = ielement_1 as IMarkerElement; IMarkerSymbol symbol3 = element2.Symbol; if (!(symbol3 is IMarkerBackgroundSupport)) { return(false); } IMarkerBackgroundSupport support = symbol3 as IMarkerBackgroundSupport; IMarkerBackground background2 = support.Background; if (background2 == null) { return(false); } if (!(background2 is ICallout)) { return(false); } icallout_0 = background2 as ICallout; return(true); } } catch { } return(false); }
//修改符号角度 public static void Angle_Symbol(ILayer layer, double angle) { try { IGeoFeatureLayer geoFeatureLayer; geoFeatureLayer = layer as IGeoFeatureLayer; ISimpleRenderer simpleRenderer = (ISimpleRenderer)geoFeatureLayer.Renderer; IMarkerSymbol mark = simpleRenderer.Symbol as IMarkerSymbol; mark.Angle = angle; geoFeatureLayer.Renderer = (IFeatureRenderer)simpleRenderer; } catch { } }
public static void ChangeSymbolSize(ISymbol pSymbol, double size) { if (pSymbol is IMarkerSymbol) { IMarkerSymbol pMarkerSymbol = pSymbol as IMarkerSymbol; pMarkerSymbol.Size = size; } else if (pSymbol is ILineSymbol) { ILineSymbol pLineSymbol = pSymbol as ILineSymbol; pLineSymbol.Width = size; } }
//点 设计 private void colorPoint_SelectedColorChanged(object sender, EventArgs e) { if (pStyleGalleryItem == null) { MessageBox.Show("请选择点样式", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } IMarkerSymbol pMarkerSymbol = pStyleGalleryItem.Item as IMarkerSymbol; pMarkerSymbol.Color = ClsGDBDataCommon.ColorToIColor(colorPoint.SelectedColor); PreviewImage(); }
private void btnPaste_Click(object sender, EventArgs e) { if (this.m_CopySymbol != null) { IMarkerSymbol markerLayer = (IMarkerSymbol)((IClone)this.m_CopySymbol).Clone(); this.m_pMultiMarkerSymbol.AddLayer(markerLayer); this.m_OldSelItem = 0; this.m_pMultiMarkerSymbol.MoveLayer(markerLayer, 0); this.InitControl((ISymbol)this.m_pMultiMarkerSymbol); this.symbolListBox1.Invalidate(); this.symbolItem1.Invalidate(); } }
private void btnAddLayer_Click(object sender, EventArgs e) { if (this.cboMarkerType.SelectedIndex != -1) { IMarkerSymbol markerLayer = this.CreateNewSymbol(this.cboMarkerType.SelectedIndex); this.m_pMultiMarkerSymbol.AddLayer(markerLayer); this.m_OldSelItem = 0; this.m_pMultiMarkerSymbol.MoveLayer(markerLayer, 0); ((ILayerColorLock)this.m_pMultiMarkerSymbol).set_LayerColorLock(0, false); this.InitControl((ISymbol)this.m_pMultiMarkerSymbol); this.symbolListBox1.Invalidate(); this.symbolItem1.Invalidate(); } }
public static bool RenderSimply(ILayer player, IColor pcolor) { ISymbol psymbol = GetSymbolFromLayer(player); IFeatureLayer pfeaturelayer = player as IFeatureLayer; IFeatureClass pfeatureclass = pfeaturelayer.FeatureClass; esriGeometryType geotype = pfeatureclass.ShapeType; switch (geotype) { case esriGeometryType.esriGeometryPoint: { IMarkerSymbol pmarksymbol = psymbol as IMarkerSymbol; pmarksymbol.Color = pcolor; break; } case esriGeometryType.esriGeometryMultipoint: { IMarkerSymbol pmarksymbol = psymbol as IMarkerSymbol; pmarksymbol.Color = pcolor; break; } case esriGeometryType.esriGeometryPolyline: { ISimpleLineSymbol psimplelinesymbol = psymbol as ISimpleLineSymbol; psimplelinesymbol.Color = pcolor; break; } case esriGeometryType.esriGeometryPolygon: { IFillSymbol pfillsymbol = psymbol as IFillSymbol; pfillsymbol.Color = pcolor; break; } default: return(false); } ISimpleRenderer psimolerenderer = new SimpleRenderer(); psimolerenderer.Symbol = psymbol; IFeatureRenderer pfeaturerender = psimolerenderer as IFeatureRenderer; IGeoFeatureLayer pgeofeaturelayer = pfeaturelayer as IGeoFeatureLayer; pgeofeaturelayer.Renderer = pfeaturerender; return(true); }
public static bool RenderSimply(ILayer layer, IColor color) { IFeatureLayer featureLayer = (IFeatureLayer)layer; esriGeometryType geotype = featureLayer.FeatureClass.ShapeType; ISymbol symbol = GetSymbolFromLayer(layer); switch (geotype) { case esriGeometryType.esriGeometryPoint: { IMarkerSymbol markerSymbol = symbol as IMarkerSymbol; markerSymbol.Color = color; break; } case esriGeometryType.esriGeometryMultipoint: { IMarkerSymbol markerSymbol = symbol as IMarkerSymbol; markerSymbol.Color = color; break; } case esriGeometryType.esriGeometryPolyline: { ISimpleLineSymbol simpleLineSymbol = symbol as ISimpleLineSymbol; simpleLineSymbol.Color = color; break; } case esriGeometryType.esriGeometryPolygon: { IFillSymbol fillSymbol = symbol as IFillSymbol; fillSymbol.Color = color; break; } default: return(false); } ISimpleRenderer simpleRenderer = new SimpleRendererClass(); simpleRenderer.Symbol = symbol; IFeatureRenderer featureRender = simpleRenderer as IFeatureRenderer; if (featureRender == null) { return(false); } IGeoFeatureLayer geoFeatureLayer = featureLayer as IGeoFeatureLayer; geoFeatureLayer.Renderer = featureRender; return(true); }
private void tnMoveDown_Click(object sender, EventArgs e) { if (this.symbolListBox1.SelectedIndex != (this.symbolListBox1.Items.Count - 1)) { this.m_OldSelItem = this.symbolListBox1.SelectedIndex + 1; IMarkerSymbol markerLayer = this.m_pMultiMarkerSymbol.get_Layer(this.symbolListBox1.SelectedIndex); this.m_pMultiMarkerSymbol.MoveLayer(markerLayer, this.m_OldSelItem); this.m_CanDo = false; this.InitControl((ISymbol)this.m_pMultiMarkerSymbol); this.m_CanDo = true; this.symbolListBox1.Invalidate(); this.symbolItem1.Invalidate(); } }
public override void OnCreate(object hook) { _context = hook as IAppContext; IRgbColor rgbColorClass = new RgbColor() { Red = 255, Green = 0, Blue = 0 }; IRgbColor rgbColor = rgbColorClass; this.imarkerSymbol_0 = new SimpleMarkerSymbol(); ((ISimpleMarkerSymbol)this.imarkerSymbol_0).Style = esriSimpleMarkerStyle.esriSMSCircle; this.imarkerSymbol_0.Color = rgbColor; this.imarkerSymbol_0.Size = 3; IRgbColor rgbColorClass1 = new RgbColor() { Red = 255, Green = 0, Blue = 0 }; IRgbColor rgbColor1 = rgbColorClass1; this.ilineSymbol_0 = new SimpleLineSymbol() { Color = rgbColor1, Width = 1.5 }; this.bool_1 = false; this.m_message = "编辑拓扑元素"; this.m_caption = "拓扑编辑工具"; this.m_toolTip = "拓扑编辑工具"; this.m_name = "Editor_Topology_EditTopologyElement"; this._key = "Editor_Topology_EditTopologyElement"; _itemType = RibbonItemType.Tool; this.m_category = "拓扑"; this.m_bitmap = Properties.Resources.TopologyEdit; this.m_cursor = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("Yutai.Plugins.Editor.Resources.Cursor.TopologyEdit.cur")); if (this._context.FocusMap != null) { if (this._context.Hook is IApplicationEvents) { (this._context.Hook as IApplicationEvents).OnActiveHookChanged += new OnActiveHookChangedHandler(this.method_0); } this.map_0 = (Map)this._context.FocusMap; this.map_0.AfterDraw += new IActiveViewEvents_AfterDrawEventHandler(this.method_3); } }
/// <summary> /// Check if a rep rule for the selected SymbolIDCode exists and if so returns it /// </summary> /// <returns>-1 if symbol not found/could not be added</returns> private int addRepRuleIdForSidc(IRepresentationClass repClass, string sidc) { if ((symbolCreator == null) || (repClass == null)) { return(-1); } int repRuleId = -1; IRepresentationRules repRules = repClass.RepresentationRules; IRepresentationRule newRule = new RepresentationRuleClass(); ISymbol symbol = symbolCreator.GetMarkerSymbolFromSIC(sidc) as ISymbol; if (symbol == null) { Console.WriteLine("ERROR: Null Symbol returned for SIDC: " + sidc); return(-1); } IMarkerSymbol markerSymbol = symbol as IMarkerSymbol; const double DEFAULT_MARKER_SIZE = 32.0; if (markerSymbol != null) { markerSymbol.Size = DEFAULT_MARKER_SIZE; } (newRule as IRepresentationRuleInit).InitWithSymbol(symbol); string symboName = symbolCreator.GetRuleNameFromSidc(sidc); if (string.IsNullOrEmpty(symboName)) { return(-1); } repRuleId = repRules.Add(newRule); repRules.set_Name(repRuleId, symboName); repRulesWereAdded = true; Console.WriteLine("Adding new RepRule for Name: {0}, SIDC:{1}", symboName, sidc); return(repRuleId); }
private void btnDeleteLayer_Click(object sender, EventArgs e) { if (this.m_pMultiMarkerSymbol.LayerCount != 1) { IMarkerSymbol markerLayer = this.m_pMultiMarkerSymbol.get_Layer(this.symbolListBox1.SelectedIndex); this.m_OldSelItem = this.symbolListBox1.SelectedIndex - 1; if (this.m_OldSelItem == -1) { this.m_OldSelItem = 0; } this.m_pMultiMarkerSymbol.DeleteLayer(markerLayer); this.InitControl((ISymbol)this.m_pMultiMarkerSymbol); this.symbolListBox1.Invalidate(); this.symbolItem1.Invalidate(); } }
private IMarkerFillSymbol CreatMarkerFillSymbol(IMarkerSymbol pMarkerSymbol, ILineSymbol pLineSymbol, IColor pColor, double xoffset, double yoffset, double xsept, double ysept) { IMarkerFillSymbol pMFillSymbol = new MarkerFillSymbolClass(); IFillProperties pFillProp = new MarkerFillSymbolClass(); pFillProp.XOffset = xoffset; pFillProp.YOffset = yoffset; pFillProp.XSeparation = xsept; pFillProp.YSeparation = ysept; pMFillSymbol = pFillProp as IMarkerFillSymbol; pMFillSymbol.MarkerSymbol = pMarkerSymbol; pMFillSymbol.Outline = pLineSymbol; pMFillSymbol.Color = pColor; pMFillSymbol.Style = esriMarkerFillStyle.esriMFSGrid; return(pMFillSymbol); }
private IClassBreaksRenderer CreateClassBreaksRenderer(IFeatureClass featureClass) { classify(); if (gClassbreaks == null) { MessageBox.Show("请先分类...", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(null); } int ClassesCount = gClassbreaks.GetUpperBound(0); if (ClassesCount == 0) { return(null); } nudClassCount.Value = ClassesCount; IClassBreaksRenderer pClassBreaksRenderer = new ClassBreaksRendererClass(); pClassBreaksRenderer.Field = strRendererField; if (strNormalizeField.ToLower() != "none") { pClassBreaksRenderer.NormField = strNormalizeField; } //设置着色对象的分级数目 pClassBreaksRenderer.BreakCount = ClassesCount; pClassBreaksRenderer.SortClassesAscending = true; pClassBreaksRenderer.BackgroundSymbol = fillSymbol; IMarkerSymbol symbol = null; if (markerSymbol == null) { MessageBox.Show("请先选择点符号", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(null); } //需要注意的是分级着色对象中的symbol和break的下标都是从0开始 double sizeInterval = (maxSize - minSize) / ClassesCount; for (int i = 0; i < ClassesCount; i++) { symbol = markerSymbol; symbol.Size = minSize + i * sizeInterval; pClassBreaksRenderer.set_Symbol(i, symbol as ISymbol); pClassBreaksRenderer.set_Break(i, gClassbreaks[i + 1]); } return(pClassBreaksRenderer); }
/// <summary> /// 在场景中绘制点要素 20110609 /// </summary> /// <param name="pGeometry">点要素</param> /// <param name="r"></param> /// <param name="g"></param> /// <param name="b"></param> /// <param name="Size">符号大小</param> /// <returns></returns> public static IElement DrawPoint(IGeometry pGeometry, int r, int g, int b, double Size) { IElement markerElement = new MarkerElementClass(); ISimpleMarker3DSymbol pSimpleMarker3DSymbol = new SimpleMarker3DSymbolClass(); pSimpleMarker3DSymbol.Style = esriSimple3DMarkerStyle.esriS3DMSSphere; pSimpleMarker3DSymbol.ResolutionQuality = 1; IMarkerSymbol pMarkerSymbol = pSimpleMarker3DSymbol as IMarkerSymbol; pMarkerSymbol.Size = Size; pMarkerSymbol.Color = getRGB(r, g, b); markerElement.Geometry = pGeometry; IMarkerElement pMarkerElement = markerElement as IMarkerElement; pMarkerElement.Symbol = pMarkerSymbol; return(markerElement); }
/// <summary> /// 构造函数 /// </summary> /// <param name="_graphcisLayer">图层</param> /// <param name="modelKml">模型kml</param> public Model3d_ArcGlobe(IGlobeGraphicsLayer _graphicLayer, KmlModel3d modelKml, IImport3DFile import3Dfile) { graphicLayer = _graphicLayer; this.ElementType = ElementTypeEnum.Model3D; // 图元类型 this.Description = modelKml.Description; // 图元描述 #region 符号 IGeometry geometry = import3Dfile.Geometry; //将模型转为3D符号 marker3DSymbol = new Marker3DSymbolClass(); marker3DSymbol.Shape = geometry; markerSymbol = marker3DSymbol as IMarkerSymbol; markerSymbol.Size = modelKml.Scale; markerSymbol.Angle = modelKml.Azimuth; IRgbColor c = new RgbColorClass(); c.Transparency = modelKml.Color.A; c.Red = modelKml.Color.R; c.Green = modelKml.Color.G; c.Blue = modelKml.Color.B; markerSymbol.Color = c; this.scale = modelKml.Scale; this.color = modelKml.Color; #endregion #region 位置 IPoint p = new PointClass(); p.PutCoords(modelKml.Position.Lng, modelKml.Position.Lat); p.Z = modelKml.Position.Alt; (p as IZAware).ZAware = true; #endregion lngLat = modelKml.Position; base.Geometry = p; //指定位置 base.Symbol = markerSymbol; //指定符号 flashTimer = new Timer(); flashTimer.Elapsed += new ElapsedEventHandler(flashTimer_Elapsed); flashTimer.Interval = 500; }
private void txtWidth_EditValueChanged(object sender, EventArgs e) { if (this.bool_0) { IMarkerSymbol symbol = this.symbolItem1.Symbol as IMarkerSymbol; if (this.txtWidth.Value <= 0M) { this.txtWidth.Value = (decimal)symbol.Size; } else { symbol.Size = (double)this.txtWidth.Value; this.bool_1 = true; this.method_5(e); } } }
public MainForm() { InitializeComponent(); MapControl = RendererHelper.GetMapControl(); MXDPath = ConfigurationManager.AppSettings["MXD"]; RoadName = ConfigurationManager.AppSettings["ROAD"]; RoadHistoryName = ConfigurationManager.AppSettings["ROADHISTORY"]; RoadNodeName = ConfigurationManager.AppSettings["ROADNODE"]; BusLineName = ConfigurationManager.AppSettings["BUSLINE"]; BusStopName = ConfigurationManager.AppSettings["BUSSTOP"]; ParkingName = ConfigurationManager.AppSettings["PARKING"]; BikeName = ConfigurationManager.AppSettings["BIKE"]; FlowName = ConfigurationManager.AppSettings["FLOW"]; StartEndName = ConfigurationManager.AppSettings["BUSSTOPNAME"]; XZQName = ConfigurationManager.AppSettings["XZQ"]; MapType = ConfigurationManager.AppSettings["MAPTYPE"]; simpleLineSymbol = new SimpleLineSymbolClass(); simpleLineSymbol.Width = 4; simpleLineSymbol.Color = DisplayHelper.GetRGBColor(255, 0, 99); simpleMarkerSymbol = new SimpleMarkerSymbolClass(); simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle; simpleMarkerSymbol.Size = 8; simpleMarkerSymbol.Color = DisplayHelper.GetRGBColor(255, 0, 0); m_CrossroadSymbol = new SimpleMarkerSymbolClass() { Style = esriSimpleMarkerStyle.esriSMSCircle, Size = 8, Color = DisplayHelper.GetRGBColor(255, 0, 0, 0), OutlineColor = DisplayHelper.GetRGBColor(255, 0, 0), OutlineSize = 3, Outline = true }; m_ImportRoadSymbol = new SimpleLineSymbolClass() { Style = esriSimpleLineStyle.esriSLSSolid, Width = 3, Color = DisplayHelper.GetRGBColor(0, 0, 0, 200) }; axMapControl1.OnAfterDraw += this.axMapControl1_OnAfterDraw; }
// // // public static void drawPointToGraphicLayer(IActiveView pActiveView, IPoint pGeom, IMarkerSymbol pSym) { try { IGraphicsContainer iGC = pActiveView as IGraphicsContainer; IElement pEle; IMarkerElement pLE; if (pGeom != null) { pEle = new MarkerElementClass() as IElement; pLE = pEle as IMarkerElement; pLE.Symbol = pSym; pEle.Geometry = pGeom; iGC.AddElement(pEle, 0); } pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, Type.Missing, pActiveView.Extent); } catch (Exception e) { MessageBox.Show(e.Message); } }
/// <summary> /// This method takes a marker symbol and adds it to the multilayer marker symbol, checks to make sure it's not a multilayer symbol first /// </summary> /// <param name="mlms"></param> /// <param name="ms"></param> /// <returns></returns> private bool AddSymbolToMultiLayerSymbol(IMultiLayerMarkerSymbol mlms, IMarkerSymbol ms) { ((ISymbol)ms).ResetDC(); IMultiLayerMarkerSymbol tempmlms = ms as IMultiLayerMarkerSymbol; try { if (tempmlms != null && tempmlms.LayerCount > 0) { for (int layerindex = 0; layerindex < tempmlms.LayerCount; layerindex++) { mlms.AddLayer(tempmlms.get_Layer(layerindex)); } } else { mlms.AddLayer(ms); } } catch (Exception ex) { LogError(ex.ToString()); return false; } return true; }
private void btnSelectSymbol_Click(object sender, EventArgs e) { ISymbol symbol = GetSymbolBySymbolSelector(esriGeometryType.esriGeometryPoint); if (symbol != null) markerSymbol = symbol as IMarkerSymbol; }
private IMarkerSymbol ApplyRotation(IMarkerSymbol pMarkerSym, IFeature pFeat) { double lAngle = 0; int tempoindex = 0; tempoindex = pFeat.Fields.FindField(m_sRotationField); lAngle = Convert.ToDouble(pFeat.get_Value(tempoindex)); if (m_eRotationType == esriSymbolRotationType.esriRotateSymbolGeographic) pMarkerSym.Angle = pMarkerSym.Angle - lAngle; else pMarkerSym.Angle = pMarkerSym.Angle + lAngle - 90; return pMarkerSym; }