/// <include file='doc\GraphicsPathIterator.uex' path='docs/doc[@for="GraphicsPathIterator.CopyData"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public int CopyData(ref PointF[] points, ref byte[] types, int startIndex, int endIndex)
        {
            if (points.Length != types.Length)
            {
                throw SafeNativeMethods.StatusException(SafeNativeMethods.InvalidParameter);
            }

            int      resultCount = 0;
            GPPOINTF pt          = new GPPOINTF();

            int size  = (int)Marshal.SizeOf(pt.GetType());
            int count = points.Length;

            IntPtr memoryPts = Marshal.AllocHGlobal(count * size);

            int status = SafeNativeMethods.GdipPathIterCopyData(new HandleRef(this, nativeIter), out resultCount,
                                                                memoryPts, types, startIndex, endIndex);

            if (status != SafeNativeMethods.Ok)
            {
                Marshal.FreeHGlobal(memoryPts);
                throw SafeNativeMethods.StatusException(status);
            }

            points = SafeNativeMethods.ConvertGPPOINTFArrayF(memoryPts, points.Length);
            Marshal.FreeHGlobal(memoryPts);

            return(resultCount);
        }
        public PointF GetLastPoint()
        {
            GPPOINTF lastPoint = new GPPOINTF();
            int      status    = SafeNativeMethods.Gdip.GdipGetPathLastPoint(new HandleRef(this, this.nativePath), lastPoint);

            if (status != 0)
            {
                throw SafeNativeMethods.Gdip.StatusException(status);
            }
            return(lastPoint.ToPoint());
        }