private void DrawPolygonRing(LinearRing ring, bool isHole, AM.StreamGeometryContext geometryContext) { Coordinate[] coords = ring.Coordinates; geometryContext.BeginFigure(new A.Point(coords[0].X, coords[0].Y), !isHole); for (int i = 1; i < coords.Length; i++) { geometryContext.LineTo(new A.Point(coords[i].X, coords[i].Y)); } geometryContext.EndFigure(true); }
public void DrawPolygon(Polygon polygon, FillStyle fillStyle, LineStyle lineStyle, PointStyle vertexStyle, bool fast) { Polygon viewPolygon = (Polygon)Viewport.GetViewGeometry(polygon); AM.PathGeometry geometry = new AM.PathGeometry(); AM.StreamGeometryContext geometryContext = geometry.Open(); DrawPolygonRing(viewPolygon.Shell, false, geometryContext); foreach (LinearRing hole in viewPolygon.Holes) { DrawPolygonRing(hole, true, geometryContext); } m_Context.DrawGeometry(new SolidColorBrush(fillStyle.Color.Argb), new Pen(new SolidColorBrush(lineStyle.Color.Argb)), geometry); DrawCoordinates(viewPolygon.Shell.Coordinates, vertexStyle, fast, true); foreach (LinearRing hole in viewPolygon.Holes) { DrawCoordinates(hole.Coordinates, vertexStyle, fast, true); } }
public GraphicsPathAdapter() { _geometryContext = _geometry.Open(); }
/// <summary> /// Initializes a new instance of the <see cref="PathMarkupParser"/> class. /// </summary> /// <param name="context">The context for the geometry.</param> public PathMarkupParser(StreamGeometryContext context) { _context = context; }
internal void ApplyTo(StreamGeometryContext ctx) { ctx.BeginFigure(StartPoint, IsFilled); foreach (var segment in Segments) { segment.ApplyTo(ctx); } ctx.EndFigure(IsClosed); }
public PathMarkupParser(StreamGeometry geometry, StreamGeometryContext context) { this.geometry = geometry; this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="PathMarkupParser"/> class. /// </summary> /// <param name="geometry">The geometry in which the path should be stored.</param> /// <param name="context">The context for <paramref name="geometry"/>.</param> public PathMarkupParser(StreamGeometry geometry, StreamGeometryContext context) { _geometry = geometry; _context = context; }
protected internal override void ApplyTo(StreamGeometryContext ctx) { ctx.ArcTo(Point, Size, RotationAngle, IsLargeArc, SweepDirection); }