コード例 #1
0
ファイル: RenderContext.cs プロジェクト: SAASTN/TopoPad
 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
ファイル: RenderContext.cs プロジェクト: SAASTN/TopoPad
        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);
            }
        }
コード例 #3
0
 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
ファイル: PathFigure.cs プロジェクト: CarlSosaDev/Avalonia
        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
ファイル: PathMarkupParser.cs プロジェクト: mikel785/Perspex
 /// <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;
 }