• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# OxyPenLineJoin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中OxyPenLineJoin的典型用法代码示例。如果您正苦于以下问题:C# OxyPenLineJoin类的具体用法?C# OxyPenLineJoin怎么用?C# OxyPenLineJoin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OxyPenLineJoin类属于命名空间,在下文中一共展示了OxyPenLineJoin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DrawLine

        public void DrawLine(IList<ScreenPoint> points, OxyColor stroke, double thickness, double[] dashArray,
                             OxyPenLineJoin lineJoin, bool aliased)
        {
            var e = new Polyline();
            if (stroke != null && thickness > 0)
            {
                e.Stroke = GetCachedBrush(stroke);

                switch (lineJoin)
                {
                    case OxyPenLineJoin.Round:
                        e.StrokeLineJoin = PenLineJoin.Round;
                        break;
                    case OxyPenLineJoin.Bevel:
                        e.StrokeLineJoin = PenLineJoin.Bevel;
                        break;
                    //  The default StrokeLineJoin is Miter
                }

                if (thickness != 1) // default values is 1
                    e.StrokeThickness = thickness;
                if (dashArray != null)
                    e.StrokeDashArray = new DoubleCollection(dashArray);
            }
            // pl.Fill = null;
            if (aliased)
                e.SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased);

            var pc = new PointCollection(points.Count);
            foreach (var p in points)
                pc.Add(ToPoint(p));
            e.Points = pc;

            Add(e);
        }
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:35,代码来源:GeometryRenderContext.cs


示例2: DrawLine

 /// <summary>
 /// Draws a polyline.
 /// </summary>
 /// <param name="points">The points.</param>
 /// <param name="stroke">The stroke color.</param>
 /// <param name="thickness">The stroke thickness.</param>
 /// <param name="dashArray">The dash array.</param>
 /// <param name="lineJoin">The line join type.</param>
 /// <param name="aliased">if set to <c>true</c> the shape will be aliased.</param>
 public abstract void DrawLine(
     IList<ScreenPoint> points,
     OxyColor stroke,
     double thickness,
     double[] dashArray,
     OxyPenLineJoin lineJoin,
     bool aliased);
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:16,代码来源:RenderContextBase.cs


示例3: DrawLine

 /// <summary>
 /// Draws a polyline.
 /// </summary>
 /// <param name="points">The points.</param>
 /// <param name="stroke">The stroke color.</param>
 /// <param name="thickness">The stroke thickness (in device independent units, 1/96 inch).</param>
 /// <param name="dashArray">The dash array (in device independent units, 1/96 inch). Use <c>null</c> to get a solid line.</param>
 /// <param name="lineJoin">The line join type.</param>
 /// <param name="aliased">if set to <c>true</c> the shape will be aliased.</param>
 public void DrawLine(
     IList<ScreenPoint> points,
     OxyColor stroke,
     double thickness = 1,
     double[] dashArray = null,
     OxyPenLineJoin lineJoin = OxyPenLineJoin.Miter,
     bool aliased = false)
 {
 }
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:18,代码来源:EmptyRenderContext.cs


示例4: OxyPen

 /// <summary>
 /// Initializes a new instance of the <see cref="OxyPen"/> class.
 /// </summary>
 /// <param name="color">
 /// The color.
 /// </param>
 /// <param name="thickness">
 /// The thickness.
 /// </param>
 /// <param name="lineStyle">
 /// The line style.
 /// </param>
 /// <param name="lineJoin">
 /// The line join.
 /// </param>
 public OxyPen(
     OxyColor color,
     double thickness = 1.0,
     LineStyle lineStyle = LineStyle.Solid,
     OxyPenLineJoin lineJoin = OxyPenLineJoin.Miter)
 {
     this.Color = color;
     this.Thickness = thickness;
     this.DashArray = LineStyleHelper.GetDashArray(lineStyle);
     this.LineStyle = lineStyle;
     this.LineJoin = lineJoin;
 }
开发者ID:AndrewTPohlmann,项目名称:open-hardware-monitor,代码行数:27,代码来源:OxyPen.cs


示例5: DrawLines

 public void DrawLines(IEnumerable<ScreenPoint> points, OxyColor stroke, double thickness, double[] dashArray,
                      OxyPenLineJoin lineJoin, bool aliased)
 {
     var startPoint = new ScreenPoint();
     bool first = true;
     foreach (var p in points)
     {
         if (!first)
         {
             Add(new Line { X1 = startPoint.X, Y1 = startPoint.Y, X2 = p.X, Y2 = p.Y });
         }
         else
         {
             startPoint = p;
         }
         first = !first;
     }
 }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:18,代码来源:GeometryRenderContext.cs


示例6: DrawLine

        public void DrawLine(IList<ScreenPoint> points, OxyColor stroke, double thickness, double[] dashArray,
                             OxyPenLineJoin lineJoin, bool aliased)
        {
            var pen = CreatePen(stroke, thickness, dashArray, lineJoin);

            // todo: alias line
            //            if (aliased)
            //              .SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased);

            var lp = new Point();
            int i = 0;
            foreach (var point in points)
            {
                var p = point.ToPoint();
                if (i > 0)
                {
                    dc.DrawLine(pen, lp, p);
                }
                i++;
                lp = p;
            }
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:22,代码来源:DrawingRenderContext.cs


示例7: CreatePen

 private static Pen CreatePen(OxyColor stroke, double thickness, double[] dashArray,
                              OxyPenLineJoin lineJoin = OxyPenLineJoin.Miter)
 {
     if (stroke == null)
         return null;
     var pen = new Pen(stroke.ToBrush(), thickness);
     if (dashArray != null)
     {
         pen.DashStyle = new DashStyle(dashArray, 0);
     }
     switch (lineJoin)
     {
         case OxyPenLineJoin.Round:
             pen.LineJoin = PenLineJoin.Round;
             break;
         case OxyPenLineJoin.Bevel:
             pen.LineJoin = PenLineJoin.Bevel;
             break;
             //  The default LineJoin is Miter
     }
     return pen;
 }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:22,代码来源:DrawingRenderContext.cs


示例8: DrawLine

        /// <summary>
        /// The draw line.
        /// </summary>
        /// <param name="points">
        /// The points.
        /// </param>
        /// <param name="stroke">
        /// The stroke.
        /// </param>
        /// <param name="thickness">
        /// The thickness.
        /// </param>
        /// <param name="dashArray">
        /// The dash array.
        /// </param>
        /// <param name="lineJoin">
        /// The line join.
        /// </param>
        /// <param name="aliased">
        /// The aliased.
        /// </param>
        public void DrawLine(
            IList<ScreenPoint> points,
            OxyColor stroke,
            double thickness,
            double[] dashArray,
            OxyPenLineJoin lineJoin,
            bool aliased)
        {
            var e = new Polyline();
            this.SetStroke(e, stroke, thickness, lineJoin, dashArray, aliased);

            var pc = new PointCollection();
            foreach (ScreenPoint p in points)
            {
                pc.Add(p.ToPoint(aliased));
            }

            e.Points = pc;

            this.Add(e);
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:42,代码来源:MetroRenderContext.cs


示例9: SetStroke

        /// <summary>
        /// Sets the stroke of the specified shape.
        /// </summary>
        /// <param name="shape">The shape.</param>
        /// <param name="stroke">The stroke.</param>
        /// <param name="thickness">The thickness.</param>
        /// <param name="lineJoin">The line join.</param>
        /// <param name="dashArray">The dash array.</param>
        /// <param name="aliased">aliased if set to <c>true</c>.</param>
        private void SetStroke(
            Shape shape,
            OxyColor stroke,
            double thickness,
            OxyPenLineJoin lineJoin = OxyPenLineJoin.Miter,
            IEnumerable<double> dashArray = null,
            bool aliased = false)
        {
            if (stroke.IsVisible() && thickness > 0)
            {
                shape.Stroke = this.GetCachedBrush(stroke);

                switch (lineJoin)
                {
                    case OxyPenLineJoin.Round:
                        shape.StrokeLineJoin = PenLineJoin.Round;
                        break;
                    case OxyPenLineJoin.Bevel:
                        shape.StrokeLineJoin = PenLineJoin.Bevel;
                        break;

                    // The default StrokeLineJoin is Miter
                }

                shape.StrokeThickness = thickness;

                if (dashArray != null)
                {
                    shape.StrokeDashArray = CreateDashArrayCollection(dashArray);
                }

                if (aliased)
                {
                    // shape.UseLayoutRounding = aliased;
                }
            }
        }
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:46,代码来源:SilverlightRenderContext.cs


示例10: DrawPolygon

        public void DrawPolygon(IList<ScreenPoint> points, OxyColor fill, OxyColor stroke, double thickness = 1, double[] dashArray = null, OxyPenLineJoin lineJoin = OxyPenLineJoin.Miter, bool aliased = false)
        {
            using (var paint = new Paint())
            {
                paint.AntiAlias = !aliased;
                paint.StrokeWidth = (float)thickness;
                using (var path = new Path())
                {
                    path.MoveTo((float)points[0].X, (float)points[0].Y);
                    for (int i = 1; i <= points.Count; i++)
                    {
                        path.LineTo((float)points[i % points.Count].X, (float)points[i % points.Count].Y);
                    }

                    if (fill != null)
                    {
                        paint.SetStyle(Paint.Style.Fill);
                        paint.Color = fill.ToColor();
                        canvas.DrawPath(path, paint);
                    }

                    if (stroke != null)
                    {
                        paint.SetStyle(Paint.Style.Stroke);
                        paint.Color = stroke.ToColor();
                        canvas.DrawPath(path, paint);
                    }
                }
            }
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:30,代码来源:CanvasRenderContext.cs


示例11: CreateStyle

        /// <summary>
        /// Creates a style.
        /// </summary>
        /// <param name="fill">The fill color.</param>
        /// <param name="stroke">The stroke color.</param>
        /// <param name="thickness">The stroke thickness (in user units).</param>
        /// <param name="dashArray">The line dash array.</param>
        /// <param name="lineJoin">The line join type.</param>
        /// <returns>A style string.</returns>
        public string CreateStyle(
            OxyColor fill,
            OxyColor stroke,
            double thickness,
            double[] dashArray = null,
            OxyPenLineJoin lineJoin = OxyPenLineJoin.Miter)
        {
            // http://oreilly.com/catalog/svgess/chapter/ch03.html
            var style = new StringBuilder();
            if (fill.IsInvisible())
            {
                style.AppendFormat("fill:none;");
            }
            else
            {
                style.AppendFormat("fill:{0};", this.ColorToString(fill));
                if (fill.A != 0xFF)
                {
                    style.AppendFormat(CultureInfo.InvariantCulture, "fill-opacity:{0};", fill.A / 255.0);
                }
            }

            if (stroke.IsInvisible())
            {
                style.AppendFormat("stroke:none;");
            }
            else
            {
                string formatString = "stroke:{0};stroke-width:{1:" + this.NumberFormat + "}";
                style.AppendFormat(CultureInfo.InvariantCulture, formatString, this.ColorToString(stroke), thickness);
                switch (lineJoin)
                {
                    case OxyPenLineJoin.Round:
                        style.AppendFormat(";stroke-linejoin:round");
                        break;
                    case OxyPenLineJoin.Bevel:
                        style.AppendFormat(";stroke-linejoin:bevel");
                        break;
                }

                if (stroke.A != 0xFF)
                {
                    style.AppendFormat(CultureInfo.InvariantCulture, ";stroke-opacity:{0}", stroke.A / 255.0);
                }

                if (dashArray != null && dashArray.Length > 0)
                {
                    style.Append(";stroke-dasharray:");
                    for (int i = 0; i < dashArray.Length; i++)
                    {
                        style.AppendFormat(
                            CultureInfo.InvariantCulture, "{0}{1}", i > 0 ? "," : string.Empty, dashArray[i]);
                    }
                }
            }

            return style.ToString();
        }
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:67,代码来源:SvgWriter.cs


示例12: DrawPolygon

		public override void DrawPolygon (IList<ScreenPoint> points, OxyColor fill, OxyColor stroke, double thickness, double[] dashArray, OxyPenLineJoin lineJoin, bool aliased)
		{
//			gctx.SetAllowsAntialiasing(aliased);

            if (fill != null)
			{
				ToColor(fill).SetFill();
				var path = new CGPath ();
	            path.AddLines(points.Select(p => ToPoint(p)).ToArray());
				path.CloseSubpath();
				gctx.AddPath(path);
	            gctx.DrawPath (CGPathDrawingMode.Fill);
			}

            if (stroke != null && thickness > 0)
			{
				SetAttributes (null, stroke, thickness);

				gctx.SetLineCap(ToLine(lineJoin));

	            var path = new CGPath ();


	            path.AddLines(points.Select(p => ToPoint(p)).ToArray());
				path.CloseSubpath();
				gctx.AddPath(path);
	            gctx.DrawPath (CGPathDrawingMode.Stroke);
			}
		}
开发者ID:acremean,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:29,代码来源:MonoTouchRenderContext.cs


示例13: DrawLine

		public override void DrawLine (IList<ScreenPoint> points, OxyColor stroke, double thickness, double[] dashArray, OxyPenLineJoin lineJoin, bool aliased)
		{
			if (stroke == null || thickness <= 0)
            {
                return;
            }

//			gctx.SetAllowsAntialiasing(aliased);

			gctx.SetLineCap(ToLine(lineJoin));

			SetAttributes (null, stroke, thickness);

            var path = new CGPath ();

            path.AddLines(points.Select(p => ToPoint(p)).ToArray());


            gctx.AddPath (path);
            gctx.DrawPath (CGPathDrawingMode.Stroke);
		}
开发者ID:acremean,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:21,代码来源:MonoTouchRenderContext.cs


示例14: DrawPolygons

        /// <summary>
        /// The draw polygons.
        /// </summary>
        /// <param name="polygons">
        /// The polygons.
        /// </param>
        /// <param name="fill">
        /// The fill.
        /// </param>
        /// <param name="stroke">
        /// The stroke.
        /// </param>
        /// <param name="thickness">
        /// The thickness.
        /// </param>
        /// <param name="dashArray">
        /// The dash array.
        /// </param>
        /// <param name="lineJoin">
        /// The line join.
        /// </param>
        /// <param name="aliased">
        /// The aliased.
        /// </param>
        public void DrawPolygons(
            IList<IList<ScreenPoint>> polygons,
            OxyColor fill,
            OxyColor stroke,
            double thickness,
            double[] dashArray,
            OxyPenLineJoin lineJoin,
            bool aliased)
        {
            var path = new Path();
            this.SetStroke(path, stroke, thickness, lineJoin, dashArray, aliased);
            if (fill != null)
            {
                path.Fill = this.GetCachedBrush(fill);
            }

            var pg = new PathGeometry { FillRule = FillRule.Nonzero };
            foreach (var polygon in polygons)
            {
                var figure = new PathFigure { IsClosed = true };
                bool first = true;
                foreach (ScreenPoint p in polygon)
                {
                    if (first)
                    {
                        figure.StartPoint = p.ToPoint(aliased);
                        first = false;
                    }
                    else
                    {
                        figure.Segments.Add(new LineSegment { Point = p.ToPoint(aliased) });
                    }
                }

                pg.Figures.Add(figure);
            }

            path.Data = pg;
            this.Add(path);
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:64,代码来源:MetroRenderContext.cs


示例15: DrawPolygon

        /// <summary>
        /// Draws a polygon. The polygon can have stroke and/or fill.
        /// </summary>
        /// <param name="points">The points.</param>
        /// <param name="fill">The fill color.</param>
        /// <param name="stroke">The stroke color.</param>
        /// <param name="thickness">The stroke thickness.</param>
        /// <param name="dashArray">The dash array.</param>
        /// <param name="lineJoin">The line join type.</param>
        /// <param name="aliased">If set to <c>true</c> the shape will be aliased.</param>
        public override void DrawPolygon(IList<ScreenPoint> points, OxyColor fill, OxyColor stroke, double thickness, double[] dashArray, OxyPenLineJoin lineJoin, bool aliased)
        {
            this.paint.Reset();
            {
                this.path.Reset();
                {
                    this.SetPath(points, aliased);
                    this.path.Close();

                    if (fill.IsVisible())
                    {
                        this.SetFill(fill);
                        this.canvas.DrawPath(this.path, this.paint);
                    }

                    if (stroke.IsVisible())
                    {
                        this.SetStroke(stroke, thickness, dashArray, lineJoin, aliased);
                        this.canvas.DrawPath(this.path, this.paint);
                    }
                }
            }
        }
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:33,代码来源:CanvasRenderContext.cs


示例16: DrawLineSegments

        /// <summary>
        /// Draws multiple line segments defined by points (0,1) (2,3) (4,5) etc.
        /// This should have better performance than calling DrawLine for each segment.
        /// </summary>
        /// <param name="points">The points.</param>
        /// <param name="stroke">The stroke color.</param>
        /// <param name="thickness">The stroke thickness.</param>
        /// <param name="dashArray">The dash array.</param>
        /// <param name="lineJoin">The line join type.</param>
        /// <param name="aliased">If set to <c>true</c> the shape will be aliased.</param>
        public override void DrawLineSegments(IList<ScreenPoint> points, OxyColor stroke, double thickness, double[] dashArray, OxyPenLineJoin lineJoin, bool aliased)
        {
            this.paint.Reset();
            {
                this.SetStroke(stroke, thickness, dashArray, lineJoin, aliased);
                this.pts.Clear();
                if (aliased)
                {
                    foreach (var p in points)
                    {
                        this.pts.Add(this.ConvertAliased(p.X));
                        this.pts.Add(this.ConvertAliased(p.Y));
                    }
                }
                else
                {
                    foreach (var p in points)
                    {
                        this.pts.Add(this.Convert(p.X));
                        this.pts.Add(this.Convert(p.Y));
                    }
                }

                this.canvas.DrawLines(this.pts.ToArray(), this.paint);
            }
        }
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:36,代码来源:CanvasRenderContext.cs


示例17: DrawLine

 /// <summary>
 /// Draws a polyline.
 /// </summary>
 /// <param name="points">The points.</param>
 /// <param name="stroke">The stroke color.</param>
 /// <param name="thickness">The stroke thickness.</param>
 /// <param name="dashArray">The dash array.</param>
 /// <param name="lineJoin">The line join type.</param>
 /// <param name="aliased">if set to <c>true</c> the shape will be aliased.</param>
 public override void DrawLine(IList<ScreenPoint> points, OxyColor stroke, double thickness, double[] dashArray, OxyPenLineJoin lineJoin, bool aliased)
 {
     this.paint.Reset();
     {
         this.path.Reset();
         {
             this.SetPath(points, aliased);
             this.SetStroke(stroke, thickness, dashArray, lineJoin, aliased);
             this.canvas.DrawPath(this.path, this.paint);
         }
     }
 }
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:21,代码来源:CanvasRenderContext.cs


示例18: DrawClippedLine

        /// <summary>
        /// Draws the clipped line.
        /// </summary>
        /// <param name="rc">The render context.</param>
        /// <param name="points">The points.</param>
        /// <param name="clippingRectangle">The clipping rectangle.</param>
        /// <param name="minDistSquared">The min dist squared.</param>
        /// <param name="stroke">The stroke.</param>
        /// <param name="strokeThickness">The stroke thickness.</param>
        /// <param name="lineStyle">The line style.</param>
        /// <param name="lineJoin">The line join.</param>
        /// <param name="aliased">if set to <c>true</c> [aliased].</param>
        /// <param name="pointsRendered">The points rendered callback.</param>
        public static void DrawClippedLine(
            this IRenderContext rc,
            IList<ScreenPoint> points,
            OxyRect clippingRectangle,
            double minDistSquared,
            OxyColor stroke,
            double strokeThickness,
            LineStyle lineStyle,
            OxyPenLineJoin lineJoin,
            bool aliased,
            Action<IList<ScreenPoint>> pointsRendered = null)
        {
            var clipping = new CohenSutherlandClipping(
                clippingRectangle.Left, clippingRectangle.Right, clippingRectangle.Top, clippingRectangle.Bottom);

            var pts = new List<ScreenPoint>();
            int n = points.Count;
            if (n > 0)
            {

                if (n == 1)
                {
                    pts.Add(points[0]);
                }

                var last = points[0];
                for (int i = 1; i < n; i++)
                {
                    var s0 = points[i - 1];
                    var s1 = points[i];

                    // Clipped version of this and next point.
                    var s0c = s0;
                    var s1c = s1;
                    bool isInside = clipping.ClipLine(ref s0c, ref s1c);
                    s0 = s1;

                    if (!isInside)
                    {
                        // keep the previous coordinate
                        continue;
                    }

                    // render from s0c-s1c
                    double dx = s1c.x - last.x;
                    double dy = s1c.y - last.y;

                    if (dx * dx + dy * dy > minDistSquared || i == 1 || i == n - 1)
                    {
                        if (!s0c.Equals(last) || i == 1)
                        {
                            pts.Add(s0c);
                        }

                        pts.Add(s1c);
                        last = s1c;
                    }

                    // render the line if we are leaving the clipping region););
                    if (!clipping.IsInside(s1))
                    {
                        if (pts.Count > 0)
                        {
                            rc.DrawLine(
                                pts, stroke, strokeThickness, LineStyleHelper.GetDashArray(lineStyle), lineJoin, aliased);
                            if (pointsRendered != null)
                            {
                                pointsRendered(pts);
                            }
                            pts = new List<ScreenPoint>();
                        }
                    }
                }

                // Check if the line contains two points and they are at the same point
                if (pts.Count == 2)
                {
                    if (pts[0].DistanceTo(pts[1]) < 1)
                    {
                        // Modify to a small horizontal line to make sure it is being rendered
                        pts[1] = new ScreenPoint(pts[0].X + 1, pts[0].Y);
                        pts[0] = new ScreenPoint(pts[0].X - 1, pts[0].Y);
                    }
                }

                // Check if the line contains a single point
                if (pts.Count == 1)
//.........这里部分代码省略.........
开发者ID:jgodinez,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:101,代码来源:RenderingExtensions.cs


示例19: DrawClippedPolygon

        /// <summary>
        /// The draw clipped polygon.
        /// </summary>
        /// <param name="rc">
        /// The render context.
        /// </param>
        /// <param name="points">
        /// The points.
        /// </param>
        /// <param name="clippingRectangle">
        /// The clipping rectangle.
        /// </param>
        /// <param name="minDistSquared">
        /// The min dist squared.
        /// </param>
        /// <param name="fill">
        /// The fill.
        /// </param>
        /// <param name="stroke">
        /// The stroke.
        /// </param>
        /// <param name="strokeThickness">
        /// The stroke thickness.
        /// </param>
        /// <param name="lineStyle">
        /// The line style.
        /// </param>
        /// <param name="lineJoin">
        /// The line join.
        /// </param>
        /// <param name="aliased">
        /// The aliased.
        /// </param>
        public static void DrawClippedPolygon(
            this IRenderContext rc,
            IList<ScreenPoint> points,
            OxyRect clippingRectangle,
            double minDistSquared,
            OxyColor fill,
            OxyColor stroke,
            double strokeThickness = 1.0,
            LineStyle lineStyle = LineStyle.Solid,
            OxyPenLineJoin lineJoin = OxyPenLineJoin.Miter,
            bool aliased = false)
        {
            var clippedPoints = SutherlandHodgmanClipping.ClipPolygon(clippingRectangle, points);

            rc.DrawPolygon(
                clippedPoints, fill, stroke, strokeThickness, LineStyleHelper.GetDashArray(lineStyle), lineJoin, aliased);
        }
开发者ID:jgodinez,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:50,代码来源:RenderingExtensions.cs


示例20: DrawClippedLineSegments

        /// <summary>
        /// Draws the clipped line segments.
        /// </summary>
        /// <param name="rc">The render context.</param>
        /// <param name="points">The points.</param>
        /// <param name="clippingRectangle">The clipping rectangle.</param>
        /// <param name="stroke">The stroke.</param>
        /// <param name="strokeThickness">The stroke thickness.</param>
        /// <param name="lineStyle">The line style.</param>
        /// <param name="lineJoin">The line join.</param>
        /// <param name="aliased">if set to <c>true</c> [aliased].</param>
        public static void DrawClippedLineSegments(
            this IRenderContext rc,
            IList<ScreenPoint> points,
            OxyRect clippingRectangle,
            OxyColor stroke,
            double strokeThickness,
            LineStyle lineStyle,
            OxyPenLineJoin lineJoin,
            bool aliased)
        {
            var clipping = new CohenSutherlandClipping(clippingRectangle.Left, clippingRectangle.Right, clippingRectangle.Top, clippingRectangle.Bottom);

            var clippedPoints = new List<ScreenPoint>(points.Count);
            for (int i = 0; i + 1 < points.Count; i += 2)
            {
                var s0 = points[i];
                var s1 = points[i + 1];
                if (clipping.ClipLine(ref s0, ref s1))
                {
                    clippedPoints.Add(s0);
                    clippedPoints.Add(s1);
                }
            }

            rc.DrawLineSegments(clippedPoints, stroke, strokeThickness, LineStyleHelper.GetDashArray(lineStyle), lineJoin, aliased);
        }
开发者ID:jgodinez,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:37,代码来源:RenderingExtensions.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# OxyRect类代码示例发布时间:2022-05-24
下一篇:
C# OxyColor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap