/*创建各种符号的公共函数 * */ /// <summary> /// 创建一个简单符号 /// </summary> /// <param name="color">色彩</param> /// <param name="size">大小</param> /// <param name="bOutLine">是否外线</param> /// <param name="OutColor">外线色彩</param> /// <param name="OutLineSize">外线大小</param> /// <param name="style">样式</param> /// <returns>正常:返回符号;异常:null</returns> public ISimpleMarkerSymbol CreateSimpleMarkerSymbol(IRgbColor color = null, double size = 7, bool bOutLine = true, IRgbColor OutColor = null, double OutLineSize = 2, esriSimpleMarkerStyle style = esriSimpleMarkerStyle.esriSMSCircle) { try { if (color == null) { color = getRGB(156, 200, 180) as IRgbColor; } if (OutColor == null) { OutColor = getRGB(70, 90, 160) as IRgbColor; } ISimpleMarkerSymbol pSimpleMarkerSymbol = new SimpleMarkerSymbolClass(); //创建SimpleMarkerSymbolClass对象 pSimpleMarkerSymbol.Color = color as IColor; pSimpleMarkerSymbol.Style = style; //设置pSimpleMarkerSymbol对象的符号类型,选择钻石 pSimpleMarkerSymbol.Size = size; //设置pSimpleMarkerSymbol对象大小,设置为5 pSimpleMarkerSymbol.Outline = bOutLine; //显示外框线 pSimpleMarkerSymbol.OutlineColor = OutColor as IColor; //为外框线设置颜色 pSimpleMarkerSymbol.OutlineSize = OutLineSize; //设置外框线的宽度 return(pSimpleMarkerSymbol); } catch (Exception) { return(null); } }
public ISimpleMarkerSymbol CreateMarkerSymbol(IColor icolor_0, esriSimpleMarkerStyle esriSimpleMarkerStyle_0, double double_0) { return(new SimpleMarkerSymbolClass { Style = esriSimpleMarkerStyle_0, Size = double_0, Color = icolor_0 }); }
//设置画捕捉时候的符号 private static ISimpleMarkerSymbol SetSnapSymbol(esriSimpleMarkerStyle pStyle) { ISimpleMarkerSymbol pMarkerSymbol = new SimpleMarkerSymbolClass(); ISymbol pSymbol = pMarkerSymbol as ISymbol; IRgbColor pRgbColor = new RgbColorClass(); pRgbColor.Transparency = 0; //采用异或方式绘制,擦除以前画的符号 pSymbol.ROP2 = esriRasterOpCode.esriROPXOrPen; pMarkerSymbol.Color = pRgbColor; pMarkerSymbol.Style = pStyle; //设置轮廓线样式 pRgbColor.Red = 255; pRgbColor.Blue = 0; pRgbColor.Green = 0; pRgbColor.Transparency = 230; pMarkerSymbol.Outline = true; pMarkerSymbol.OutlineColor = pRgbColor; pMarkerSymbol.OutlineSize = 1; pMarkerSymbol.Size = 12; return(pMarkerSymbol); }
public static ISimpleMarkerSymbol get_SimplePointSymbol(IColor color, double size, esriSimpleMarkerStyle style) { ISimpleMarkerSymbol theReturn = new SimpleMarkerSymbolClass(); theReturn.Color = color; theReturn.Style = style; theReturn.Size = size; return theReturn; }
private void method_1(IPoint ipoint_1, esriSimpleMarkerStyle esriSimpleMarkerStyle_0) { this.ianchorPoint_0 = new AnchorPoint() { Symbol = this.isimpleMarkerSymbol_0 as ISymbol }; this.ianchorPoint_0.MoveTo(ipoint_1, this.iactiveView_0.ScreenDisplay); }
internal static void AddNewAnchorPt(IPoint ipoint_0, esriSimpleMarkerStyle esriSimpleMarkerStyle_0, IActiveView pActiveView) { SketchToolAssist.m_pAP = new AnchorPoint() { Symbol = SketchToolAssist.m_pSym as ISymbol }; SketchToolAssist.m_pAP.MoveTo(ipoint_0, pActiveView.ScreenDisplay); }
/// <summary> /// 点样式,没有设置outline /// </summary> /// <param name="color"></param> /// <param name="size"></param> /// <param name="estyle"></param> /// <returns></returns> public static IMarkerSymbol CreateMarkerSymbol(IRgbColor color, double size, esriSimpleMarkerStyle estyle) { ISimpleMarkerSymbol pSymbol = new SimpleMarkerSymbolClass(); pSymbol.Color = color as IColor; pSymbol.Size = size; pSymbol.Style = estyle; return(pSymbol); }
/// <summary> /// 生成点符号 /// </summary> /// <param name="color"></param> /// <param name="width"></param> /// <param name="style"></param> /// <returns></returns> public ISymbol CreateSimpleSymbol(Color color, int size, esriSimpleMarkerStyle style) { ISimpleMarkerSymbol pMarkerSymbol = new SimpleMarkerSymbol();; IRgbColor pRgbColor = GetColor(color.R, color.G, color.B) as IRgbColor; pMarkerSymbol.Size = size; pMarkerSymbol.Color = pRgbColor; pMarkerSymbol.Style = style; return(pMarkerSymbol as ISymbol); }
public static ISimpleMarkerSymbol CreateSimpleMarkerSymbol(IRgbColor rgbColor, esriSimpleMarkerStyle inputStyle) { if (rgbColor == null || inputStyle == null) { return null; } ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass(); simpleMarkerSymbol.Color = rgbColor; simpleMarkerSymbol.Style = inputStyle; return simpleMarkerSymbol; }
/// <summary> /// 创建点要素样式 /// </summary> /// <param name="color">颜色</param> /// <param name="size">大小</param> /// <param name="style">样式</param> /// <returns>ISymbol</returns> public static ISymbol CreateSimpleMarkSymbol(Color color, double size = 2, esriSimpleMarkerStyle style = esriSimpleMarkerStyle.esriSMSCross) { ISimpleMarkerSymbol pSimpleLineSymbol; pSimpleLineSymbol = new SimpleMarkerSymbol(); pSimpleLineSymbol.Color = new RgbColor() { Red = color.R, Green = color.G, Blue = color.B, Transparency = color.A }; pSimpleLineSymbol.Style = style; //样式 pSimpleLineSymbol.Size = size; //大小 return((ISymbol)pSimpleLineSymbol); }
/// <summary> /// This function will return a simple marker symbol with the size, color and style that is passed in. /// </summary> /// <param name="style">the marker symbol style to use from the esriSimpleMarkerStyle enum (ieL: circle, cross, diamond, etc)</param> /// <param name="size">the size of the symbol to be rendered</param> /// <param name="color">The ESRI.ArcGIS.Display.IColor object to use as the color</param> /// <returns>ISimpleMarkerSymbol as ISymbol</returns> public static ISymbol ReturnSimpleMarkerSymbol(esriSimpleMarkerStyle style, int size, IColor color) { ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass { Style = style, Size = size, Color = color }; ISymbol symbol = simpleMarkerSymbol as ISymbol; symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen; return(symbol); }
private IElement GetElement(IGeometry geometry, double size, esriSimpleMarkerStyle simpleMarkerStyle) { IElement element; IMarkerElement markerElement = new MarkerElementClass(); element = markerElement as IElement; ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass(); simpleMarkerSymbol.Style = simpleMarkerStyle; simpleMarkerSymbol.Color = ColorSelection.GetColor(); simpleMarkerSymbol.Size = size; element.Geometry = geometry; markerElement.Symbol = simpleMarkerSymbol; return element; }
//在MAPCONTROL上表现出捕捉点 private static void DrawRectangle(IActiveView pActiveView, IPoint pPoint, Dictionary <IPointCollection, string> dicPointCollection) { pActiveView.ScreenDisplay.StartDrawing(pActiveView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache); esriSimpleMarkerStyle pStyle = esriSimpleMarkerStyle.esriSMSCircle; foreach (KeyValuePair <IPointCollection, string> keyValue in dicPointCollection) { for (int i = 0; i < keyValue.Key.PointCount; i++) { if (pPoint.X == keyValue.Key.get_Point(i).X&& pPoint.Y == keyValue.Key.get_Point(i).Y) { switch (keyValue.Value) { case "PortPnt": pStyle = esriSimpleMarkerStyle.esriSMSCircle; break; case "MidPnt": pStyle = esriSimpleMarkerStyle.esriSMSDiamond; break; case "Node": pStyle = esriSimpleMarkerStyle.esriSMSSquare; break; case "IntersectPnt": pStyle = esriSimpleMarkerStyle.esriSMSX; break; case "NearestPnt": pStyle = esriSimpleMarkerStyle.esriSMSCircle; break; } break; } } } pActiveView.ScreenDisplay.SetSymbol(SetSnapSymbol(pStyle) as ISymbol); pActiveView.ScreenDisplay.DrawPoint(pPoint); pActiveView.ScreenDisplay.FinishDrawing(); }
/// <summary> /// 简单点 /// </summary> /// <param name="size"></param> /// <param name="color"></param> /// <param name="style"></param> /// <param name="outLineSymbol"></param> /// <returns></returns> private IMarkerSymbol DefinePointSymbol(double size, IColor color, esriSimpleMarkerStyle style, ILineSymbol outLineSymbol) { ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass(); IMarkerSymbol markerSymbol = (IMarkerSymbol)simpleMarkerSymbol; simpleMarkerSymbol.Size = size; //定义点符号大小 simpleMarkerSymbol.Color = color; //定义点符号颜色 simpleMarkerSymbol.Style = style; //定义点符号样式 if (outLineSymbol == null) { simpleMarkerSymbol.Outline = false; } else { simpleMarkerSymbol.Outline = true; //定义点符号边线 simpleMarkerSymbol.OutlineColor = outLineSymbol.Color; simpleMarkerSymbol.OutlineSize = outLineSymbol.Width; } return(markerSymbol); }
private IElement GetElement(IGeometry geometry, double size, esriSimpleMarkerStyle simpleMarkerStyle) { IElement element; IMarkerElement markerElement = new MarkerElementClass(); element = markerElement as IElement; ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass(); simpleMarkerSymbol.Style = simpleMarkerStyle; simpleMarkerSymbol.Color = ColorSelection.GetColor(); simpleMarkerSymbol.Size = size; element.Geometry = geometry; markerElement.Symbol = simpleMarkerSymbol; return(element); }
private ISimpleMarkerSymbol creatsimpoint(Color color, esriSimpleMarkerStyle style, double size, double angle, double xoffset, double yoffset, Color outcolor, double outsize) { ISimpleMarkerSymbol pSimSymbol = new SimpleMarkerSymbolClass(); pSimSymbol.Color = ClsGDBDataCommon.ColorToIColor(color); pSimSymbol.Style = style; pSimSymbol.Size = size; pSimSymbol.Angle = angle; pSimSymbol.XOffset = xoffset; pSimSymbol.YOffset = yoffset; if (checkBoxX1.Checked == true) { pSimSymbol.Outline = true; pSimSymbol.OutlineColor = ClsGDBDataCommon.ColorToIColor(outcolor); pSimSymbol.OutlineSize = outsize; } else { pSimSymbol.Outline = false; } return(pSimSymbol); }
public SimpleMarkerSymbol(esriSimpleMarkerStyle style, Color color, double size) { Style = style; Color = color; Size = size; }
public PointElement(IGeometry geometry, double size, esriSimpleMarkerStyle simpleMarkerStyle) { _element = GetElement(geometry, size, simpleMarkerStyle); _elementProperties = GetElementProperties(); }
public SimpleMarkerSymbol(esriSimpleMarkerStyle style, System.Drawing.Color color, double size) : this(style, new RgbColor(color), size) { }
public KeyValuePair <Guid, IPoint> AddGraphicToMap( IGeometry geom, IColor color, int number, bool showNums, string textName, string guid = null, esriSimpleMarkerStyle markerStyle = esriSimpleMarkerStyle.esriSMSCircle, int size = 5) { var emptyResult = new KeyValuePair <Guid, IPoint>(); if ((geom == null) || (geom.GeometryType != esriGeometryType.esriGeometryPoint) || (geom.SpatialReference == null) ) { return(emptyResult); } var simpleMarkerSymbol = (ISimpleMarkerSymbol) new SimpleMarkerSymbol(); simpleMarkerSymbol.Color = color; simpleMarkerSymbol.Outline = false; simpleMarkerSymbol.OutlineColor = color; simpleMarkerSymbol.Size = size; simpleMarkerSymbol.Style = markerStyle; var markerElement = (IMarkerElement) new MarkerElement(); markerElement.Symbol = simpleMarkerSymbol; IElement element = null; element = (IElement)markerElement; if (element == null) { return(emptyResult); } element.Geometry = geom; element.Geometry.SpatialReference = activeView.FocusMap.SpatialReference; var eprop = (IElementProperties)element; var newGuid = Guid.NewGuid().ToString(); var pointGuid = (String.IsNullOrEmpty(guid)) ? newGuid : guid; eprop.Name = pointGuid + geoCalcPointsSuffix; var ge = new GraphicElement() { Source = geom, Name = eprop.Name, Element = element }; if (allGraphics[MilSpaceGraphicsTypeEnum.GeoCalculator].Exists(el => el.Name == eprop.Name)) { DeleteGraphicsElement(ge, true, true); } graphics.AddElement(element, 0); allGraphics[MilSpaceGraphicsTypeEnum.GeoCalculator].Add(ge); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); if (showNums) { var point = geom as IPoint; DrawText(point, number.ToString(), $"{textName}{pointGuid}", MilSpaceGraphicsTypeEnum.GeoCalculator, color); } return(new KeyValuePair <Guid, IPoint>(Guid.Parse(pointGuid), element.Geometry as IPoint)); }
/// <summary> /// Adds a graphic element to the map graphics container /// </summary> /// <param name="geom">IGeometry</param> internal string AddGraphicToMap(IGeometry geom, IColor color, bool IsTempGraphic = false, esriSimpleMarkerStyle markerStyle = esriSimpleMarkerStyle.esriSMSCircle, int size = 5, IColor borderColor = null) { if (borderColor == null) { borderColor = color; } if (geom == null || ArcMap.Document == null || ArcMap.Document.FocusMap == null) { return(string.Empty); } IElement element = null; geom.Project(ArcMap.Document.FocusMap.SpatialReference); if (geom.GeometryType == esriGeometryType.esriGeometryPoint) { // Marker symbols var simpleMarkerSymbol = (ISimpleMarkerSymbol) new SimpleMarkerSymbol(); simpleMarkerSymbol.Color = color; simpleMarkerSymbol.Outline = true; simpleMarkerSymbol.OutlineColor = borderColor; simpleMarkerSymbol.Size = size; simpleMarkerSymbol.Style = markerStyle; var markerElement = (IMarkerElement) new MarkerElement(); markerElement.Symbol = simpleMarkerSymbol; element = (IElement)markerElement; } else if (geom.GeometryType == esriGeometryType.esriGeometryPolyline) { // create graphic then add to map var le = (ILineElement) new LineElementClass(); element = (IElement)le; var lineSymbol = new SimpleLineSymbolClass(); lineSymbol.Color = color; lineSymbol.Width = (double)size; le.Symbol = lineSymbol; } else if (geom.GeometryType == esriGeometryType.esriGeometryPolygon) { // create graphic then add to map IPolygonElement pe = (IPolygonElement) new PolygonElementClass(); element = pe as IElement; IFillShapeElement fe = (IFillShapeElement)pe; var fillSymbol = new SimpleFillSymbolClass(); RgbColor selectedColor = new RgbColorClass(); selectedColor.Red = 0; selectedColor.Green = 0; selectedColor.Blue = 0; selectedColor.Transparency = (byte)0; fillSymbol.Color = selectedColor; fe.Symbol = fillSymbol; } if (element == null) { return(string.Empty); } element.Geometry = geom; var av = (IActiveView)ArcMap.Document.FocusMap; var gc = (IGraphicsContainer)av; // store guid var eprop = (IElementProperties)element; eprop.Name = Guid.NewGuid().ToString(); GraphicsList.Add(new AMGraphic(eprop.Name, geom, IsTempGraphic)); gc.AddElement(element, 0); av.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); RaisePropertyChanged(() => HasMapGraphics); return(eprop.Name); }
public bool Snap2Point2(IPoint ipoint_1, IPoint ipoint_2, esriSimpleMarkerStyle esriSimpleMarkerStyle_0) { if (!Editor.UseOldSnap) { ISnappingResult snappingResult = SketchToolAssist.m_psnaper.Snap(ipoint_1); if (snappingResult == null) { if (this.ianchorPoint_0 == null) { this.ianchorPoint_0 = new AnchorPoint() { Symbol = this.isimpleMarkerSymbol_0 as ISymbol }; } this.ianchorPoint_0.MoveTo(ipoint_1, this.iactiveView_0.ScreenDisplay); this.bool_0 = false; } else { ipoint_2 = snappingResult.Location; this.bool_0 = true; if (this.ianchorPoint_0 != null) { this.ianchorPoint_0.MoveTo(snappingResult.Location, this.iactiveView_0.ScreenDisplay); } else { this.method_1(snappingResult.Location, esriSimpleMarkerStyle_0); } } } else { ISimpleMarkerSymbol isimpleMarkerSymbol0 = this.isimpleMarkerSymbol_0; isimpleMarkerSymbol0.Style = esriSimpleMarkerStyle_0; if (ipoint_2 == null) { ipoint_2 = new ESRI.ArcGIS.Geometry.Point(); } ipoint_2.PutCoords(ipoint_1.X, ipoint_1.Y); if (this.iengineSnapEnvironment_0 is SnapEnvironment) { if ((!ApplicationRef.AppContext.Config.UseSnap ? true : !(this.iengineSnapEnvironment_0 as SnapEnvironment).SnapPoint(ipoint_1, ipoint_2))) { this.bool_0 = false; if (this.ianchorPoint_0 != null) { this.ianchorPoint_0.Symbol = (ISymbol)isimpleMarkerSymbol0; this.ianchorPoint_0.MoveTo(ipoint_1, this.iactiveView_0.ScreenDisplay); } else { this.method_1(ipoint_1, esriSimpleMarkerStyle_0); } } else { this.bool_0 = true; if (this.ianchorPoint_0 != null) { this.ianchorPoint_0.Symbol = (ISymbol)isimpleMarkerSymbol0; this.ianchorPoint_0.MoveTo(ipoint_2, this.iactiveView_0.ScreenDisplay); } else { this.method_1(ipoint_2, esriSimpleMarkerStyle_0); } } } else if ((this.iengineSnapEnvironment_0 == null || !ApplicationRef.AppContext.Config.UseSnap ? true : !this.iengineSnapEnvironment_0.SnapPoint(ipoint_2))) { this.bool_0 = false; if (this.ianchorPoint_0 != null) { this.ianchorPoint_0.Symbol = (ISymbol)isimpleMarkerSymbol0; this.ianchorPoint_0.MoveTo(ipoint_1, this.iactiveView_0.ScreenDisplay); } else { this.method_1(ipoint_1, esriSimpleMarkerStyle_0); } } else { this.bool_0 = true; if (this.ianchorPoint_0 != null) { this.ianchorPoint_0.Symbol = (ISymbol)isimpleMarkerSymbol0; this.ianchorPoint_0.MoveTo(ipoint_2, this.iactiveView_0.ScreenDisplay); } else { this.method_1(ipoint_2, esriSimpleMarkerStyle_0); } } } return(this.bool_0); }
/// <summary> /// 获取简单点符号SimpleMarkerSymbol /// </summary> /// <param name="rrggbbtt">点符号的颜色,6位颜色值RRGGBB,如"ff0000"为红色; /// 或8位颜色值RRGGBBTT,如"ff0000ff"为红色不透明(最后两位00表示透明,ff表示不透明)</param> /// <param name="outlineColorRrggbbtt">点符号的边线颜色,6位颜色值RRGGBB,如"ff0000"为红色; /// 或8位颜色值RRGGBBTT,如"ff0000ff"为红色不透明(最后两位00表示透明,ff表示不透明)</param> /// <param name="pointSize">点的大小</param> /// <param name="markerStyle">设置符号样式:默认为菱形形状</param> /// <returns></returns> public static ISimpleMarkerSymbol GetSimpleMarkerSymbol(string rrggbbtt, string outlineColorRrggbbtt = null, double pointSize = 6, esriSimpleMarkerStyle markerStyle = esriSimpleMarkerStyle.esriSMSDiamond) { return(GetSimpleMarkerSymbol(ColorCreate.GetIColor(rrggbbtt), ColorCreate.GetIColor(outlineColorRrggbbtt), pointSize, markerStyle)); }
public static void Snap2Point(IPoint ipoint_0, IPoint ipoint_1, esriSimpleMarkerStyle esriSimpleMarkerStyle_0, IActiveView iactiveView_0, IEngineSnapEnvironment iengineSnapEnvironment_0) { IHitTest mPPointColn; double num; int num1; int num2; bool flag; double mapUnits; IPoint pointClass; if (!Editor.UseOldSnap) { ISnappingResult snappingResult = SketchToolAssist.m_psnaper.Snap(ipoint_0); if (snappingResult == null) { if (SketchToolAssist.m_pAP == null) { SketchToolAssist.m_pAP = new AnchorPoint() { Symbol = SketchShareEx.m_pSym as ISymbol }; } SketchToolAssist.m_pAP.MoveTo(SketchShareEx.m_pAnchorPoint, iactiveView_0.ScreenDisplay); } else { SketchShareEx.m_pAnchorPoint = snappingResult.Location; if (SketchToolAssist.m_pAP != null) { SketchToolAssist.m_pAP.MoveTo(snappingResult.Location, iactiveView_0.ScreenDisplay); } else { SketchToolAssist.AddNewAnchorPt(snappingResult.Location, esriSimpleMarkerStyle_0, iactiveView_0); } } } else { SketchShareEx.m_pSym.Style = esriSimpleMarkerStyle_0; if (iengineSnapEnvironment_0 is ISnapEnvironment) { ISnapEnvironment iengineSnapEnvironment0 = iengineSnapEnvironment_0 as ISnapEnvironment; if ((iengineSnapEnvironment0 == null || !ApplicationRef.AppContext.Config.UseSnap ? true : !iengineSnapEnvironment0.SnapPoint(SketchShareEx.LastPoint, ipoint_0))) { if (ApplicationRef.AppContext.Config.IsSnapSketch) { mPPointColn = SketchToolAssist.m_pPointColn as IHitTest; if (mPPointColn != null) { num = 0; num1 = 0; num2 = 0; flag = false; mapUnits = CommonHelper.ConvertPixelsToMapUnits(iactiveView_0, iengineSnapEnvironment0.SnapTolerance); if (mapUnits == 0) { mapUnits = 3; } pointClass = new ESRI.ArcGIS.Geometry.Point(); if ( !mPPointColn.HitTest(ipoint_0, mapUnits, esriGeometryHitPartType.esriGeometryPartVertex, pointClass, ref num, ref num1, ref num2, ref flag)) { SketchShareEx.m_bSnapSuccessful = false; if (SketchToolAssist.m_pAP != null) { SketchToolAssist.m_pAP.MoveTo(ipoint_0, iactiveView_0.ScreenDisplay); } else { SketchToolAssist.AddNewAnchorPt(ipoint_0, esriSimpleMarkerStyle_0, iactiveView_0); } return; } ipoint_0.PutCoords(pointClass.X, pointClass.Y); SketchShareEx.m_bSnapSuccessful = true; if (SketchToolAssist.m_pAP != null) { SketchToolAssist.m_pAP.MoveTo(ipoint_0, iactiveView_0.ScreenDisplay); return; } else { SketchToolAssist.AddNewAnchorPt(ipoint_0, esriSimpleMarkerStyle_0, iactiveView_0); return; } } } } else { SketchShareEx.m_bSnapSuccessful = true; if (SketchToolAssist.m_pAP != null) { SketchToolAssist.m_pAP.MoveTo(ipoint_0, iactiveView_0.ScreenDisplay); } else { SketchToolAssist.AddNewAnchorPt(ipoint_0, esriSimpleMarkerStyle_0, iactiveView_0); } } } else if ((iengineSnapEnvironment_0 == null || !ApplicationRef.AppContext.Config.UseSnap ? true : !iengineSnapEnvironment_0.SnapPoint(ipoint_0))) { if (ApplicationRef.AppContext.Config.IsSnapSketch) { mPPointColn = SketchToolAssist.m_pPointColn as IHitTest; if (mPPointColn != null) { num = 0; num1 = 0; num2 = 0; flag = false; mapUnits = iengineSnapEnvironment_0.SnapTolerance; if (iengineSnapEnvironment_0.SnapToleranceUnits == esriEngineSnapToleranceUnits.esriEngineSnapTolerancePixels) { mapUnits = CommonHelper.ConvertPixelsToMapUnits(iactiveView_0, iengineSnapEnvironment_0.SnapTolerance); } if (mapUnits == 0) { mapUnits = 3; } pointClass = new ESRI.ArcGIS.Geometry.Point(); if ( !mPPointColn.HitTest(ipoint_0, mapUnits, esriGeometryHitPartType.esriGeometryPartVertex, pointClass, ref num, ref num1, ref num2, ref flag)) { SketchShareEx.m_bSnapSuccessful = false; if (SketchToolAssist.m_pAP != null) { SketchToolAssist.m_pAP.MoveTo(ipoint_0, iactiveView_0.ScreenDisplay); } else { SketchToolAssist.AddNewAnchorPt(ipoint_0, esriSimpleMarkerStyle_0, iactiveView_0); } return; } ipoint_0.PutCoords(pointClass.X, pointClass.Y); SketchShareEx.m_bSnapSuccessful = true; if (SketchToolAssist.m_pAP != null) { SketchToolAssist.m_pAP.MoveTo(ipoint_0, iactiveView_0.ScreenDisplay); return; } else { SketchToolAssist.AddNewAnchorPt(ipoint_0, esriSimpleMarkerStyle_0, iactiveView_0); return; } } } } else { SketchShareEx.m_bSnapSuccessful = true; if (SketchToolAssist.m_pAP != null) { SketchToolAssist.m_pAP.MoveTo(ipoint_0, iactiveView_0.ScreenDisplay); } else { SketchToolAssist.AddNewAnchorPt(ipoint_0, esriSimpleMarkerStyle_0, iactiveView_0); } } } }
/// <summary> /// Adds a graphic element to the map graphics container /// </summary> /// <param name="geom">IGeometry</param> internal void AddGraphicToMap(IGeometry geom, IColor color, bool IsTempGraphic = false, esriSimpleMarkerStyle markerStyle = esriSimpleMarkerStyle.esriSMSCircle, esriRasterOpCode rasterOpCode = esriRasterOpCode.esriROPNOP) { if (geom == null || ArcMap.Document == null || ArcMap.Document.FocusMap == null) { return; } IElement element = null; double width = 2.0; geom.Project(ArcMap.Document.FocusMap.SpatialReference); if (geom.GeometryType == esriGeometryType.esriGeometryPoint) { // Marker symbols var simpleMarkerSymbol = new SimpleMarkerSymbol() as ISimpleMarkerSymbol; simpleMarkerSymbol.Color = color; simpleMarkerSymbol.Outline = true; simpleMarkerSymbol.OutlineColor = color; simpleMarkerSymbol.Size = 5; simpleMarkerSymbol.Style = markerStyle; var markerElement = new MarkerElement() as IMarkerElement; markerElement.Symbol = simpleMarkerSymbol; element = markerElement as IElement; } else if (geom.GeometryType == esriGeometryType.esriGeometryPolyline) { // create graphic then add to map var lineSymbol = new SimpleLineSymbolClass(); lineSymbol.Color = color; lineSymbol.Width = width; if (IsTempGraphic && rasterOpCode != esriRasterOpCode.esriROPNOP) { lineSymbol.Width = 1; lineSymbol.ROP2 = rasterOpCode; } var le = new LineElementClass() as ILineElement; element = le as IElement; le.Symbol = lineSymbol; } if (element == null) { return; } IClone clone = geom as IClone; element.Geometry = clone as IGeometry; var mxdoc = ArcMap.Application.Document as IMxDocument; var av = mxdoc.FocusMap as IActiveView; var gc = av as IGraphicsContainer; // store guid var eprop = element as IElementProperties; eprop.Name = Guid.NewGuid().ToString(); if (this is LinesViewModel) { GraphicsList.Add(new Graphic(GraphicTypes.Line, eprop.Name, geom, IsTempGraphic)); } else if (this is CircleViewModel) { GraphicsList.Add(new Graphic(GraphicTypes.Circle, eprop.Name, geom, IsTempGraphic)); } else if (this is EllipseViewModel) { GraphicsList.Add(new Graphic(GraphicTypes.Ellipse, eprop.Name, geom, IsTempGraphic)); } else if (this is RangeViewModel) { GraphicsList.Add(new Graphic(GraphicTypes.RangeRing, eprop.Name, geom, IsTempGraphic)); } gc.AddElement(element, 0); //refresh map av.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); if (!IsTempGraphic) { RaisePropertyChanged(() => HasMapGraphics); } }
/// <summary> /// 获取简单点符号SimpleMarkerSymbol /// </summary> /// <param name="color">点内部颜色</param> /// <param name="outlineColor">点符号的边线</param> /// <param name="pointSize">点样式的大小</param> /// <param name="markerStyle">设置符号样式:默认为菱形形状</param> /// <returns></returns> public static ISimpleMarkerSymbol GetSimpleMarkerSymbol(IColor color, IColor outlineColor = null, double pointSize = 6, esriSimpleMarkerStyle markerStyle = esriSimpleMarkerStyle.esriSMSDiamond) { ISimpleMarkerSymbol markerSymbol = new SimpleMarkerSymbolClass(); markerSymbol.Style = markerStyle; markerSymbol.Color = color; markerSymbol.Size = pointSize; markerSymbol.Outline = true; markerSymbol.OutlineColor = outlineColor ?? ColorCreate.GetIColor(128, 138, 135); markerSymbol.OutlineSize = 1; return(markerSymbol); }
/// <summary> /// 双击事件,双击后,定位到指定的层要素 NAME+“:”+OID+点 接边检查 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void JoinCheck(object sender) { DataGridView view = (DataGridView)sender; //将当前操作的对象转成控件对象,以方便操作 string temp = view.CurrentRow.Cells[0].Value.ToString(); //得到点击行的第一个单元格内容 int DesID = Convert.ToInt32(view.CurrentRow.Cells[1].Value.ToString()); //选定行的第二个单元格 IPoint pErrPnt = view.CurrentRow.Cells[2].Value as IPoint; string className = ""; //要素类的名称 int OrginID = 0; //源要素类的要素ID char[] p = { ' ' }; //以空格为分割点 char[] s = { ':' }; //以:为分割点 string[] para = temp.Split(p); string[] org = para[0].Split(s); //得到源ID串 className = org[0]; OrginID = Convert.ToInt32(org[1]); IFeature fu = null; //得到源要素 IFeature Des_feature = null; //目标要素 int n = _AppHk.MapControl.Map.LayerCount; if (n == 0) { return; } //遍历找出我们指定层 for (int S = 0; S < n; S++) { ILayer layer = _AppHk.MapControl.Map.get_Layer(S); //判别是不是组,如果是,就从组中取一个层 if (layer is IGroupLayer) { if (layer.Name == "更新修编数据" || layer.Name == "工作库数据" || layer.Name == "现势库数据") { ICompositeLayer C_layer = layer as ICompositeLayer;//得到组合图层 for (int c = 0; c < C_layer.Count; c++) { ILayer temp_layer = C_layer.get_Layer(c); IFeatureLayer F_layer = temp_layer as IFeatureLayer; IDataset set = F_layer.FeatureClass as IDataset; if (className == set.Name) { m_CurLayer = temp_layer; fu = F_layer.FeatureClass.GetFeature(OrginID); //得到要素 Des_feature = F_layer.FeatureClass.GetFeature(DesID); //目标要素 break; } } } } } if (fu != null && Des_feature != null) { _AppHk.MapControl.Map.ClearSelection(); //每次进来前先清除之前选择过的 _AppHk.MapControl.Map.SelectFeature(m_CurLayer, fu); //在对应的层上选择指定的元素 _AppHk.MapControl.Map.SelectFeature(m_CurLayer, Des_feature); //在对应的层上选择指定的元素 //SysCommon.Gis.ModGisPub.ZoomToFeature(_AppHk.MapControl, fu);//定位到相应的层 ITopologicalOperator pTop = pErrPnt as ITopologicalOperator; IGeometry pGeometry = pTop.Buffer(30); IEnvelope pEnvelope = pGeometry.Envelope; if (pEnvelope == null) { return; } pEnvelope.Expand(12, 0, false); IActiveView pActiveView = _AppHk.MapControl.Map as IActiveView; pActiveView.Extent = pEnvelope; pActiveView.Refresh(); Application.DoEvents(); //画出对应的点 if (pErrPnt != null) { _AppHk.MapControl.ActiveView.ScreenDisplay.StartDrawing(_AppHk.MapControl.ActiveView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache); esriSimpleMarkerStyle pStyle = esriSimpleMarkerStyle.esriSMSCircle; _AppHk.MapControl.ActiveView.ScreenDisplay.SetSymbol(SetSnapSymbol(pStyle) as ISymbol); _AppHk.MapControl.ActiveView.ScreenDisplay.DrawPoint(pErrPnt); _AppHk.MapControl.ActiveView.ScreenDisplay.FinishDrawing(); } } }
public static ISimpleMarkerSymbol CreateSimpleMarkSysbol(IColor color, float size, esriSimpleMarkerStyle markerstyle, IRgbColor outlineColor = null, float outlineSize = 0) { ISimpleMarkerSymbol markerSymbol = new SimpleMarkerSymbol(); markerSymbol.Style = markerstyle; markerSymbol.Color = color; markerSymbol.Size = size; if (outlineColor != null) { markerSymbol.OutlineColor = outlineColor; markerSymbol.OutlineSize = outlineSize; } return(markerSymbol); }
private void btnadd_Click(object sender, EventArgs e) { if (superTabControl1.SelectedTabIndex == 0) { esriSimpleMarkerStyle style = new esriSimpleMarkerStyle(); if (cbSimpleStyle.SelectedIndex == 0) { style = esriSimpleMarkerStyle.esriSMSCircle; } else if (cbSimpleStyle.SelectedIndex == 1) { style = esriSimpleMarkerStyle.esriSMSSquare; } else if (cbSimpleStyle.SelectedIndex == 2) { style = esriSimpleMarkerStyle.esriSMSCross; } else if (cbSimpleStyle.SelectedIndex == 3) { style = esriSimpleMarkerStyle.esriSMSX; } else { style = esriSimpleMarkerStyle.esriSMSDiamond; } if (superTabControl1.SelectedTabIndex == 0) { if (checkBoxX1.Checked == true) { ISimpleMarkerSymbol pSimMarSymbol = creatsimpoint(colorsimple.SelectedColor, style, sizesimple.Value, anglesimple.Value, xsimoffset.Value, ysimoffset.Value, outcolor.SelectedColor, outsize.Value); addListBoxItem(pSimMarSymbol as ISymbol); } else { ISimpleMarkerSymbol pSimMarSymbol = creatsimpoint(colorsimple.SelectedColor, style, sizesimple.Value, anglesimple.Value, xsimoffset.Value, ysimoffset.Value, Color.Empty, 0); addListBoxItem(pSimMarSymbol as ISymbol); } } } else if (superTabControl1.SelectedTabIndex == 1) { if (picfilename == "") { MessageBox.Show("请先选择图片", "提示", MessageBoxButtons.OK); } else { IPictureMarkerSymbol pPicMarSymbol = creatpicpoint(sizepicture.Value, xpicoffset.Value, ypicoffset.Value, anglepicture.Value, backcolorpic.SelectedColor, picfilename); addListBoxItem(pPicMarSymbol as ISymbol); } } else if (superTabControl1.SelectedTabIndex == 2) { IArrowMarkerSymbol pArrMarPoint = creatarrowpoint(colorarrow.SelectedColor, lengtharrow.Value, widtharrow.Value, anglearrow.Value, xarroffset.Value, yarroffset.Value); addListBoxItem(pArrMarPoint as ISymbol); } else if (superTabControl1.SelectedTabIndex == 3) { if (filename3D == "") { MessageBox.Show("请先选择模型", "提示", MessageBoxButtons.OK); } else { IMarker3DSymbol p3DMarSymbol = creat3dmarkerpoint(isuse3d, filename3D); addListBoxItem(p3DMarSymbol as ISymbol); } } RePainPictureBox(Radio); }
/// <summary> /// Adds a graphic element to the map graphics container /// </summary> /// <param name="geom">IGeometry</param> internal string AddGraphicToMap(IGeometry geom, IColor color, bool IsTempGraphic = false, esriSimpleMarkerStyle markerStyle = esriSimpleMarkerStyle.esriSMSCircle, int size = 5) { if (geom == null || ArcMap.Document == null || ArcMap.Document.FocusMap == null) return string.Empty; IElement element = null; double width = 2.0; geom.Project(ArcMap.Document.FocusMap.SpatialReference); if (geom.GeometryType == esriGeometryType.esriGeometryPoint) { // Marker symbols var simpleMarkerSymbol = new SimpleMarkerSymbol() as ISimpleMarkerSymbol; simpleMarkerSymbol.Color = color; simpleMarkerSymbol.Outline = true; simpleMarkerSymbol.OutlineColor = color; simpleMarkerSymbol.Size = size; simpleMarkerSymbol.Style = markerStyle; var markerElement = new MarkerElement() as IMarkerElement; markerElement.Symbol = simpleMarkerSymbol; element = markerElement as IElement; } else if (geom.GeometryType == esriGeometryType.esriGeometryPolyline) { // create graphic then add to map var le = new LineElementClass() as ILineElement; element = le as IElement; var lineSymbol = new SimpleLineSymbolClass(); lineSymbol.Color = color; lineSymbol.Width = width; le.Symbol = lineSymbol; } else if (geom.GeometryType == esriGeometryType.esriGeometryPolygon) { // create graphic then add to map IPolygonElement pe = new PolygonElementClass() as IPolygonElement; element = pe as IElement; IFillShapeElement fe = pe as IFillShapeElement; var fillSymbol = new SimpleFillSymbolClass(); RgbColor selectedColor = new RgbColorClass(); selectedColor.Red = 0; selectedColor.Green = 0; selectedColor.Blue = 0; selectedColor.Transparency = (byte)0; fillSymbol.Color = selectedColor; fe.Symbol = fillSymbol; } if (element == null) return string.Empty; element.Geometry = geom; var mxdoc = ArcMap.Application.Document as IMxDocument; var av = mxdoc.FocusMap as IActiveView; var gc = av as IGraphicsContainer; // store guid var eprop = element as IElementProperties; eprop.Name = Guid.NewGuid().ToString(); if (IsTempGraphic) TempGraphicsList.Add(eprop.Name); else MapGraphicsList.Add(eprop.Name); gc.AddElement(element, 0); av.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); RaisePropertyChanged(() => HasMapGraphics); return eprop.Name; }
/// <summary> /// Adds a graphic element to the map graphics container /// Returns GUID /// </summary> /// <param name="geom">IGeometry</param> public static KeyValuePair <string, IPoint> AddGraphicToMap( IGeometry geom, IColor color, bool IsTempGraphic = false, esriSimpleMarkerStyle markerStyle = esriSimpleMarkerStyle.esriSMSCircle, int size = 5) { var emptyResult = new KeyValuePair <string, IPoint>(); if ((geom == null) || (ArcMap.Document == null) || (ArcMap.Document.FocusMap == null) || (ArcMap.Document.FocusMap.SpatialReference == null)) { return(emptyResult); } IElement element = null; geom.Project(ArcMap.Document.FocusMap.SpatialReference); if (geom.GeometryType != esriGeometryType.esriGeometryPoint) { return(emptyResult); } var simpleMarkerSymbol = (ISimpleMarkerSymbol) new SimpleMarkerSymbol(); simpleMarkerSymbol.Color = color; simpleMarkerSymbol.Outline = false; simpleMarkerSymbol.OutlineColor = color; simpleMarkerSymbol.Size = size; simpleMarkerSymbol.Style = markerStyle; var markerElement = (IMarkerElement) new MarkerElement(); markerElement.Symbol = simpleMarkerSymbol; element = (IElement)markerElement; if (element == null) { return(emptyResult); } element.Geometry = geom; var mxdoc = ArcMap.Application.Document as IMxDocument; if (mxdoc == null) { return(emptyResult); } var av = (IActiveView)mxdoc.FocusMap; var gc = (IGraphicsContainer)av; // store guid var eprop = (IElementProperties)element; eprop.Name = Guid.NewGuid().ToString(); gc.AddElement(element, 0); av.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); return(new KeyValuePair <string, IPoint>(eprop.Name, element.Geometry as IPoint)); }
/// <summary> /// 简单点 /// </summary> /// <param name="size"></param> /// <param name="color"></param> /// <param name="style"></param> /// <param name="outLineSymbol"></param> /// <returns></returns> private IMarkerSymbol DefinePointSymbol(double size, IColor color, esriSimpleMarkerStyle style, ILineSymbol outLineSymbol) { ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass(); IMarkerSymbol markerSymbol = (IMarkerSymbol)simpleMarkerSymbol; simpleMarkerSymbol.Size = size; //定义点符号大小 simpleMarkerSymbol.Color = color; //定义点符号颜色 simpleMarkerSymbol.Style = style; //定义点符号样式 if (outLineSymbol == null) { simpleMarkerSymbol.Outline = false; } else { simpleMarkerSymbol.Outline = true; //定义点符号边线 simpleMarkerSymbol.OutlineColor = outLineSymbol.Color; simpleMarkerSymbol.OutlineSize = outLineSymbol.Width; } return markerSymbol; }
/// <summary> /// Adds a graphic element to the map graphics container /// </summary> /// <param name="geom">IGeometry</param> internal void AddGraphicToMap(IGeometry geom, IColor color, bool IsTempGraphic = false, esriSimpleMarkerStyle markerStyle = esriSimpleMarkerStyle.esriSMSCircle, esriRasterOpCode rasterOpCode = esriRasterOpCode.esriROPNOP) { if (geom == null || ArcMap.Document == null || ArcMap.Document.FocusMap == null) return; IElement element = null; double width = 2.0; geom.Project(ArcMap.Document.FocusMap.SpatialReference); if(geom.GeometryType == esriGeometryType.esriGeometryPoint) { // Marker symbols var simpleMarkerSymbol = new SimpleMarkerSymbol() as ISimpleMarkerSymbol; simpleMarkerSymbol.Color = color; simpleMarkerSymbol.Outline = true; simpleMarkerSymbol.OutlineColor = color; simpleMarkerSymbol.Size = 5; simpleMarkerSymbol.Style = markerStyle; var markerElement = new MarkerElement() as IMarkerElement; markerElement.Symbol = simpleMarkerSymbol; element = markerElement as IElement; } else if(geom.GeometryType == esriGeometryType.esriGeometryPolyline) { // create graphic then add to map var lineSymbol = new SimpleLineSymbolClass(); lineSymbol.Color = color; lineSymbol.Width = width; if (IsTempGraphic && rasterOpCode != esriRasterOpCode.esriROPNOP) { lineSymbol.Width = 1; lineSymbol.ROP2 = rasterOpCode; } var le = new LineElementClass() as ILineElement; element = le as IElement; le.Symbol = lineSymbol; } if (element == null) return; IClone clone = geom as IClone; element.Geometry = clone as IGeometry; var mxdoc = ArcMap.Application.Document as IMxDocument; var av = mxdoc.FocusMap as IActiveView; var gc = av as IGraphicsContainer; // store guid var eprop = element as IElementProperties; eprop.Name = Guid.NewGuid().ToString(); if (this is LinesViewModel) GraphicsList.Add(new Graphic(GraphicTypes.Line, eprop.Name, geom, IsTempGraphic)); else if (this is CircleViewModel) GraphicsList.Add(new Graphic(GraphicTypes.Circle, eprop.Name, geom, IsTempGraphic)); else if (this is EllipseViewModel) GraphicsList.Add(new Graphic(GraphicTypes.Ellipse, eprop.Name, geom, IsTempGraphic)); else if (this is RangeViewModel) GraphicsList.Add(new Graphic(GraphicTypes.RangeRing, eprop.Name, geom, IsTempGraphic)); gc.AddElement(element, 0); //refresh map av.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); if (!IsTempGraphic) RaisePropertyChanged(() => HasMapGraphics); }
/// <summary> /// Adds a graphic element to the map graphics container /// Returns GUID /// </summary> /// <param name="geom">IGeometry</param> public static string AddGraphicToMap(IGeometry geom, IColor color, bool IsTempGraphic = false, esriSimpleMarkerStyle markerStyle = esriSimpleMarkerStyle.esriSMSCircle, int size = 5) { if (geom == null || ArcMap.Document == null || ArcMap.Document.FocusMap == null) { return(string.Empty); } IElement element = null; double width = 2.0; geom.Project(ArcMap.Document.FocusMap.SpatialReference); if (geom.GeometryType == esriGeometryType.esriGeometryPoint) { // Marker symbols var simpleMarkerSymbol = new SimpleMarkerSymbol() as ISimpleMarkerSymbol; simpleMarkerSymbol.Color = color; simpleMarkerSymbol.Outline = false; simpleMarkerSymbol.OutlineColor = color; simpleMarkerSymbol.Size = size; simpleMarkerSymbol.Style = markerStyle; var markerElement = new MarkerElement() as IMarkerElement; markerElement.Symbol = simpleMarkerSymbol; element = markerElement as IElement; } else if (geom.GeometryType == esriGeometryType.esriGeometryPolyline) { // create graphic then add to map var le = new LineElementClass() as ILineElement; element = le as IElement; var lineSymbol = new SimpleLineSymbolClass(); lineSymbol.Color = color; lineSymbol.Width = width; le.Symbol = lineSymbol; } else if (geom.GeometryType == esriGeometryType.esriGeometryPolygon) { // create graphic then add to map IPolygonElement pe = new PolygonElementClass() as IPolygonElement; element = pe as IElement; IFillShapeElement fe = pe as IFillShapeElement; var fillSymbol = new SimpleFillSymbolClass(); RgbColor selectedColor = new RgbColorClass(); selectedColor.Red = 0; selectedColor.Green = 0; selectedColor.Blue = 0; selectedColor.Transparency = (byte)0; fillSymbol.Color = selectedColor; fe.Symbol = fillSymbol; } if (element == null) { return(string.Empty); } element.Geometry = geom; var mxdoc = ArcMap.Application.Document as IMxDocument; var av = mxdoc.FocusMap as IActiveView; var gc = av as IGraphicsContainer; // store guid var eprop = element as IElementProperties; eprop.Name = Guid.NewGuid().ToString(); gc.AddElement(element, 0); av.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); return(eprop.Name); }
public void Snap2Point(IPoint ipoint_1, IPoint ipoint_2, esriSimpleMarkerStyle esriSimpleMarkerStyle_0) { ISnappingResult snappingResult; this.AnchorPoint = ipoint_1; if (!Editor.UseOldSnap) { snappingResult = SketchToolAssist.m_psnaper.Snap(this.AnchorPoint); if (snappingResult == null) { if (this.ianchorPoint_0 == null) { this.ianchorPoint_0 = new AnchorPoint() { Symbol = this.isimpleMarkerSymbol_0 as ISymbol }; } this.ianchorPoint_0.MoveTo(this.AnchorPoint, (this._appContext.MapControl.Map as IActiveView).ScreenDisplay); } else { this.AnchorPoint = snappingResult.Location; if (this.ianchorPoint_0 == null) { this.ianchorPoint_0 = new AnchorPoint() { Symbol = this.isimpleMarkerSymbol_0 as ISymbol }; } this.ianchorPoint_0.MoveTo(this.AnchorPoint, (this._appContext.MapControl.Map as IActiveView).ScreenDisplay); } } else { IAppContext application = ApplicationRef.AppContext; snappingResult = this.method_0(this.AnchorPoint); if (snappingResult == null) { if (this.ianchorPoint_0 == null) { this.ianchorPoint_0 = new AnchorPoint() { Symbol = this.isimpleMarkerSymbol_0 as ISymbol }; } this.ianchorPoint_0.MoveTo(this.AnchorPoint, (this._appContext.MapControl.Map as IActiveView).ScreenDisplay); } else { this.AnchorPoint = snappingResult.Location; if (this.ianchorPoint_0 == null) { this.ianchorPoint_0 = new AnchorPoint() { Symbol = this.isimpleMarkerSymbol_0 as ISymbol }; } this.ianchorPoint_0.MoveTo(this.AnchorPoint, (this._appContext.MapControl.Map as IActiveView).ScreenDisplay); } } }