Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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();
 }
Esempio n. 4
0
 /// <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;
 }
Esempio n. 5
0
 /// <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;
 }
Esempio n. 6
0
        internal void ApplyTo(StreamGeometryContext ctx)
        {
            ctx.BeginFigure(StartPoint, IsFilled);

            foreach (var segment in Segments)
            {
                segment.ApplyTo(ctx);
            }

            ctx.EndFigure(IsClosed);
        }
Esempio n. 7
0
 public PathMarkupParser(StreamGeometry geometry, StreamGeometryContext context)
 {
     this.geometry = geometry;
     this.context  = context;
 }
Esempio n. 8
0
 /// <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;
 }
Esempio n. 9
0
 protected internal override void ApplyTo(StreamGeometryContext ctx)
 {
     ctx.ArcTo(Point, Size, RotationAngle, IsLargeArc, SweepDirection);
 }
Esempio n. 10
0
 public PathMarkupParser(StreamGeometry geometry, StreamGeometryContext context)
 {
     this.geometry = geometry;
     this.context = context;
 }
Esempio n. 11
0
 /// <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;
 }