void freepolygon(List <Point> logPntArr) { //显示绘制的自由面 IMSPolygon polygon = new IMSPolygon(CoordinateType.Logic); polygon.Stroke = new SolidColorBrush(Colors.Red); //设置边框颜色 polygon.Shape.Fill = new SolidColorBrush(Colors.Red); //填充颜色 polygon.Shape.Fill.Opacity = 0.5; //填充区域透明度 this.graphicsLayer.AddGraphics(polygon); //添加对象 polygon.Draw(logPntArr); //绘制对象 }
public IMSPolygon drawGetFeature(SFeatureGeometry sfeatureTemp) { GRegion reg = sfeatureTemp.RegGeom[0]; AnyLine arcLine = reg.Rings[0]; Arc arc = arcLine.Arcs[0]; //获取要素边界的点 Dot_2D[] Arcpnts = arc.Dots; int arcpntNum = Arcpnts.Length; //绘制多边形 IMSPolygon poly = new IMSPolygon(CoordinateType.Logic); m_gpLayer.AddGraphics(poly); for (int i = 0; i < arcpntNum; i++) { poly.Points.Add(new Point(arc.Dots[i].x, arc.Dots[i].y)); } poly.Draw(); return(poly); }
private void reDrawMeasurePnts(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { IsDrawOver = true; this.m_graphicsLayer.RemoveGraphics(this.measurePnts[this.measurePnts.Count - 1]); this.measurePnts.RemoveAt(this.measurePnts.Count - 1); if (this.measureMarks != null && this.measureMarks.Count != 0) { this.mymarklayer.RemoveMark(this.measureMarks[this.measureMarks.Count - 1]); this.measureMarks.RemoveAt(this.measureMarks.Count - 1); } if (this.measureCenterMarks != null && this.measureCenterMarks.Count != 0) { this.mymarklayer.RemoveMark(this.measureCenterMarks[this.measureCenterMarks.Count - 1]); this.measureCenterMarks.RemoveAt(this.measureCenterMarks.Count - 1); this.mymarklayer.RemoveMark(this.measureCenterMarks[this.measureCenterMarks.Count - 1]); this.measureCenterMarks.RemoveAt(this.measureCenterMarks.Count - 1); } switch (graphics.DrawingType) { case DrawingType.Polyline: IMSPolyline pl = new IMSPolyline(CoordinateType.Logic) { EnableEdit = true }; this.m_graphicsLayer.AddGraphics(pl); for (int i = 0; i < logPntArr.Count; i++) { pl.Points.Add(logPntArr[i]); } pl.Draw(); pl.EditMark1DragInCallback += new EditMarkDelegate(markLengthMove); pl.EditMark1DragOverCallback += new EditMarkDelegate(markOver); pl.EditMark2DragInCallback += new EditMarkDelegate(mark2LengthMove); pl.EditMark2DragOverCallback += new EditMarkDelegate(mark2LengthOver); pl.EnableEdit = false; measureGraphic.Add(pl); break; case DrawingType.Polygon: IMSPolygon p2 = new IMSPolygon(CoordinateType.Logic) { EnableEdit = true }; this.m_graphicsLayer.AddGraphics(p2); for (int i = 0; i < logPntArr.Count; i++) { p2.Points.Add(logPntArr[i]); } p2.Draw(); p2.EditMark1DragInCallback += new EditMarkDelegate(markAreaMove); p2.EditMark1DragOverCallback += new EditMarkDelegate(markOver); p2.EnableEdit = false; measureGraphic.Add(p2); break; } // if (this.measureMark != null) // { // (this.measureMark.MarkControl as Label).Content = ""; // (this.measureMark.MarkControl as Label).Visibility = System.Windows.Visibility.Collapsed; // } // if (this.measurePnts != null) // { // for (int i = 0; i < this.measurePnts.Count; i++) // { // this.m_graphicsLayer.RemoveGraphics(this.measurePnts[i]); // } // } this.m_mapContainer.MouseMove -= new MouseEventHandler(m_graphicsLayer_MouseMove); }