当前位置: 首页>>代码示例>>C#>>正文


C# StreamGeometryContext.PolyBezierTo方法代码示例

本文整理汇总了C#中System.Windows.Media.StreamGeometryContext.PolyBezierTo方法的典型用法代码示例。如果您正苦于以下问题:C# StreamGeometryContext.PolyBezierTo方法的具体用法?C# StreamGeometryContext.PolyBezierTo怎么用?C# StreamGeometryContext.PolyBezierTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Media.StreamGeometryContext的用法示例。


在下文中一共展示了StreamGeometryContext.PolyBezierTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawFigure

        public static void DrawFigure(StreamGeometryContext ctx, PathFigure figure)
        {
            ctx.BeginFigure(figure.StartPoint, figure.IsFilled, figure.IsClosed);
            foreach (var segment in figure.Segments)
            {
                var lineSegment = segment as WpfLineSegment;
                if (lineSegment != null) { ctx.LineTo(lineSegment.Point, lineSegment.IsStroked, lineSegment.IsSmoothJoin); continue; }

                var bezierSegment = segment as BezierSegment;
                if (bezierSegment != null) { ctx.BezierTo(bezierSegment.Point1, bezierSegment.Point2, bezierSegment.Point3, bezierSegment.IsStroked, bezierSegment.IsSmoothJoin); continue; }

                var quadraticSegment = segment as QuadraticBezierSegment;
                if (quadraticSegment != null) { ctx.QuadraticBezierTo(quadraticSegment.Point1, quadraticSegment.Point2, quadraticSegment.IsStroked, quadraticSegment.IsSmoothJoin); continue; }

                var polyLineSegment = segment as PolyLineSegment;
                if (polyLineSegment != null) { ctx.PolyLineTo(polyLineSegment.Points, polyLineSegment.IsStroked, polyLineSegment.IsSmoothJoin); continue; }

                var polyBezierSegment = segment as PolyBezierSegment;
                if (polyBezierSegment != null) { ctx.PolyBezierTo(polyBezierSegment.Points, polyBezierSegment.IsStroked, polyBezierSegment.IsSmoothJoin); continue; }

                var polyQuadraticSegment = segment as PolyQuadraticBezierSegment;
                if (polyQuadraticSegment != null) { ctx.PolyQuadraticBezierTo(polyQuadraticSegment.Points, polyQuadraticSegment.IsStroked, polyQuadraticSegment.IsSmoothJoin); continue; }

                var arcSegment = segment as ArcSegment;
                if (arcSegment != null) { ctx.ArcTo(arcSegment.Point, arcSegment.Size, arcSegment.RotationAngle, arcSegment.IsLargeArc, arcSegment.SweepDirection, arcSegment.IsStroked, arcSegment.IsSmoothJoin); continue; }
            }
        }
开发者ID:WenzCao,项目名称:automatic-graph-layout,代码行数:27,代码来源:GraphmapsNode.cs

示例2: AddFigureToStreamGeometryContext

        /// <summary>
        /// Private helper to render a path figure to the SGC
        /// </summary>
        private static void AddFigureToStreamGeometryContext(StreamGeometryContext context, List<Point> points, bool isBezierFigure)
        {
            Debug.Assert(context != null);
            Debug.Assert(points != null);
            Debug.Assert(points.Count > 0);

            context.BeginFigure(points[points.Count - 1], //start point
                                        true,   //isFilled
                                        true);  //IsClosed

            if (isBezierFigure)
            {
                context.PolyBezierTo(points,
                                     true,      //isStroked
                                     true);     //isSmoothJoin
            }
            else
            {
                context.PolyLineTo(points,
                                     true,      //isStroked
                                     true);     //isSmoothJoin
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:26,代码来源:StrokeRenderer.cs

示例3: SerializeData

 /// <summary>
 /// SerializeData - Serialize the contents of this Segment to the provided context.
 /// </summary>
 internal override void SerializeData(StreamGeometryContext ctx)
 {
     ctx.PolyBezierTo(Points, IsStroked, IsSmoothJoin);
 }                                    
开发者ID:JianwenSun,项目名称:cc,代码行数:7,代码来源:PolyBezierSegmentFigureLogic.cs


注:本文中的System.Windows.Media.StreamGeometryContext.PolyBezierTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。