Example #1
0
 internal static extern int GdipGetPathLastPoint(HandleRef path, GPPOINTF lastPoint);
Example #2
0
 internal static extern int GdipEnumerateMetafileSrcRectDestPoint(HandleRef graphics,
                                                                  HandleRef metafile,
                                                                  GPPOINTF destPoint,
                                                                  ref GPRECTF srcRect,
                                                                  int pageUnit,
                                                                  Graphics.EnumerateMetafileProc callback,
                                                                  HandleRef callbackdata,
                                                                  HandleRef imageattributes);
Example #3
0
            //----------------------------------------------------------------------------------------                                                           
            // Helper function:  Convert GpPointF* memory block to PointF[]
            //----------------------------------------------------------------------------------------
            internal static PointF[] ConvertGPPOINTFArrayF(IntPtr memory, int count) {
                if (memory == IntPtr.Zero)
                    throw new ArgumentNullException("memory");

                PointF[] points = new PointF[count];

                int index;
                GPPOINTF pt = new GPPOINTF();

                int size = (int)Marshal.SizeOf(pt.GetType());

                for (index=0; index < count; index++) {
                    pt = (GPPOINTF)  UnsafeNativeMethods.PtrToStructure((IntPtr)((long)memory+index*size), pt.GetType());
                    points[index] = new PointF(pt.X, pt.Y);
                }

                return points;
            }
Example #4
0
 internal static extern int GdipEnumerateMetafileDestPoint(HandleRef graphics,
                                                           HandleRef metafile,
                                                           GPPOINTF destPoint,
                                                           Graphics.EnumerateMetafileProc callback,
                                                           HandleRef callbackdata,
                                                           HandleRef imageattributes);
Example #5
0
 internal static extern int GdipSetPathGradientCenterPoint(HandleRef brush,
                                                           GPPOINTF point);
Example #6
0
 internal static extern int GdipCreateLineBrush(GPPOINTF point1, GPPOINTF point2, int color1, int color2, int wrapMode, out IntPtr lineGradient);
 internal static PointF[] ConvertGPPOINTFArrayF(IntPtr memory, int count)
 {
     if (memory == IntPtr.Zero)
     {
         throw new ArgumentNullException("memory");
     }
     PointF[] tfArray = new PointF[count];
     GPPOINTF gppointf = new GPPOINTF();
     int num2 = Marshal.SizeOf(gppointf.GetType());
     for (int i = 0; i < count; i++)
     {
         gppointf = (GPPOINTF) UnsafeNativeMethods.PtrToStructure((IntPtr) (((long) memory) + (i * num2)), gppointf.GetType());
         tfArray[i] = new PointF(gppointf.X, gppointf.Y);
     }
     return tfArray;
 }
Example #8
0
        /// <include file='doc\GraphicsPath.uex' path='docs/doc[@for="GraphicsPath.GetLastPoint"]/*' />
        /// <devdoc>
        ///    Gets the last point in the <see cref='System.Drawing.Drawing2D.GraphicsPath.PathPoints'/> array of this <see cref='System.Drawing.Drawing2D.GraphicsPath'/>.
        /// </devdoc>
        public PointF GetLastPoint() {
            GPPOINTF gppt = new GPPOINTF();
            
            int status = SafeNativeMethods.Gdip.GdipGetPathLastPoint(new HandleRef(this, nativePath), gppt);

            if (status != SafeNativeMethods.Gdip.Ok)
                throw SafeNativeMethods.Gdip.StatusException(status);
                
            return gppt.ToPoint();
        }