コード例 #1
0
        internal static CGPoint[] ConvertPoints(PointCollection pointCollection)
        {
            if (pointCollection == null || pointCollection.Count == 0)
            {
                return(new CGPoint[0]);
            }

            CGPoint[] points = new CGPoint[pointCollection.Count];
            Point[]   array  = new Point[pointCollection.Count];
            pointCollection.CopyTo(array, 0);

            for (int i = 0; i < array.Length; i++)
            {
                points[i] = new CGPoint(array[i].X, array[i].Y);
            }

            return(points);
        }
コード例 #2
0
        public static WPointCollection ToWindows(this PointCollection pointCollection)
        {
            if (pointCollection == null || pointCollection.Count == 0)
            {
                return(new WPointCollection());
            }

            WPointCollection points = new WPointCollection();

            Point[] array = new Point[pointCollection.Count];
            pointCollection.CopyTo(array, 0);

            for (int i = 0; i < array.Length; i++)
            {
                points.Add(new WPoint(array[i].X, array[i].Y));
            }

            return(points);
        }