Emgu.CV.PointCollection.PolyLine C# (CSharp) Метод

PolyLine() публичный статический Метод

convert a series of points to LineSegment2D
public static PolyLine ( PointF points, bool closed ) : Emgu.CV.Structure.LineSegment2DF[]
points System.Drawing.PointF the array of points
closed bool if true, the last line segment is defined by the last point of the array and the first point of the array
Результат Emgu.CV.Structure.LineSegment2DF[]
        public static LineSegment2DF[] PolyLine(PointF[] points, bool closed)
        {
            LineSegment2DF[] res;
             int length = points.Length;
             if (closed)
             {
            res = new LineSegment2DF[length];
            PointF lastPoint = points[length - 1];
            for (int i = 0; i < res.Length; i++)
            {
               res[i] = new LineSegment2DF(lastPoint, points[i]);
               lastPoint = points[i];
            }
             }
             else
             {
            res = new LineSegment2DF[length - 1];
            PointF lastPoint = points[0];
            for (int i = 1; i < res.Length; i++)
            {
               res[i] = new LineSegment2DF(lastPoint, points[i]);
               lastPoint = points[i];
            }
             }

             return res;
        }

Same methods

PointCollection::PolyLine ( Point points, bool closed ) : Emgu.CV.Structure.LineSegment2D[]