示例#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);
 }
示例#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();
 }
示例#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;
 }
示例#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;
 }
示例#6
0
        internal void ApplyTo(StreamGeometryContext ctx)
        {
            ctx.BeginFigure(StartPoint, IsFilled);

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

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