Author: spouliot
Date: 2007-02-16 16:58:22 -0500 (Fri, 16 Feb 2007)
New Revision: 73045
Modified:
trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
trunk/mcs/class/System.Drawing/System.Drawing/Image.cs
trunk/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
Log:
2007-02-16 Sebastien Pouliot <[EMAIL PROTECTED]>
* gdipFunctions.cs: Fix some p/invoke definitions (int versus uint)
and add more for metafile functions.
* Image.cs: Fix usage of corrected p/invoke signatures.
Modified: trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog 2007-02-16
20:33:51 UTC (rev 73044)
+++ trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog 2007-02-16
21:58:22 UTC (rev 73045)
@@ -1,3 +1,9 @@
+2007-02-16 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * gdipFunctions.cs: Fix some p/invoke definitions (int versus uint)
+ and add more for metafile functions.
+ * Image.cs: Fix usage of corrected p/invoke signatures.
+
2007-02-14 Jonathan Pobst <[EMAIL PROTECTED]>
* SystemColors.cs: Query Windows for the colors added to this class
Modified: trunk/mcs/class/System.Drawing/System.Drawing/Image.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Image.cs 2007-02-16
20:33:51 UTC (rev 73044)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Image.cs 2007-02-16
21:58:22 UTC (rev 73045)
@@ -339,16 +339,15 @@
return eps;
}
- public int GetFrameCount(FrameDimension dimension)
+ public int GetFrameCount (FrameDimension dimension)
{
- int count;
+ uint count;
Guid guid = dimension.Guid;
- Status status = GDIPlus.GdipImageGetFrameCount (nativeObject,
ref guid, out count);
- GDIPlus.CheckStatus (status);
+ Status status = GDIPlus.GdipImageGetFrameCount (nativeObject,
ref guid, out count);
+ GDIPlus.CheckStatus (status);
- return count;
-
+ return (int) count;
}
public PropertyItem GetPropertyItem(int propid)
@@ -576,11 +575,11 @@
[DesignerSerializationVisibility
(DesignerSerializationVisibility.Hidden)]
public int Height {
get {
- int height;
+ uint height;
Status status = GDIPlus.GdipGetImageHeight
(nativeObject, out height);
GDIPlus.CheckStatus (status);
- return height;
+ return (int)height;
}
}
Modified: trunk/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
2007-02-16 20:33:51 UTC (rev 73044)
+++ trunk/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
2007-02-16 21:58:22 UTC (rev 73045)
@@ -1001,7 +1001,7 @@
internal static extern Status GdipImageGetFrameDimensionsList (
IntPtr image, [Out] Guid [] dimensionIDs, uint count );
[DllImport("gdiplus.dll")]
- internal static extern Status GdipGetImageHeight (IntPtr image,
out int height);
+ internal static extern Status GdipGetImageHeight (IntPtr image,
out uint height);
[DllImport("gdiplus.dll")]
internal static extern Status GdipGetImageHorizontalResolution
( IntPtr image, out float resolution );
@@ -1052,7 +1052,7 @@
internal static extern Status GdipGetEncoderParameterList (
IntPtr image, ref Guid encoder, uint size, IntPtr buffer );
[DllImport("gdiplus.dll")]
- internal static extern Status GdipImageGetFrameCount (IntPtr
image, ref Guid guidDimension, out int count );
+ internal static extern Status GdipImageGetFrameCount (IntPtr
image, ref Guid guidDimension, out uint count );
[DllImport("gdiplus.dll")]
internal static extern Status GdipImageSelectActiveFrame
(IntPtr image, ref Guid guidDimension, int frameIndex);
@@ -1623,6 +1623,10 @@
[DllImport ("gdiplus.dll")]
internal static extern Status GdipGetHemfFromMetafile (IntPtr
metafile, out IntPtr hEmf);
[DllImport ("gdiplus.dll")]
+ internal static extern Status
GdipGetMetafileDownLevelRasterizationLimit (IntPtr metafile, ref uint
metafileRasterizationLimitDpi);
+ [DllImport ("gdiplus.dll")]
+ internal static extern Status
GdipSetMetafileDownLevelRasterizationLimit (IntPtr metafile, uint
metafileRasterizationLimitDpi);
+ [DllImport ("gdiplus.dll")]
internal static extern Status GdipPlayMetafileRecord (IntPtr
metafile, EmfPlusRecordType recordType, int flags, int dataSize, byte[] data);
#if !TEST
[DllImport("gdiplus.dll", ExactSpelling=true,
CharSet=CharSet.Unicode)]
@@ -1894,14 +1898,26 @@
[DllImport("gdiplus.dll")]
internal static extern Status GdipCreateFromXDrawable_linux
(IntPtr drawable, IntPtr display, out IntPtr graphics);
- // Stream functions for non-Win32 (libgdiplus specific(
+ // Stream functions for non-Win32 (libgdiplus specific)
[DllImport("gdiplus.dll")]
- static internal extern Status GdipLoadImageFromDelegate_linux (
StreamGetHeaderDelegate getHeader, StreamGetBytesDelegate getBytes,
StreamPutBytesDelegate putBytes,
- StreamSeekDelegate
doSeek, StreamCloseDelegate close, StreamSizeDelegate size, out IntPtr image);
+ static internal extern Status GdipLoadImageFromDelegate_linux
(StreamGetHeaderDelegate getHeader,
+ StreamGetBytesDelegate getBytes, StreamPutBytesDelegate
putBytes, StreamSeekDelegate doSeek,
+ StreamCloseDelegate close, StreamSizeDelegate size, out
IntPtr image);
+
[DllImport("gdiplus.dll")]
- static internal extern Status GdipSaveImageToDelegate_linux (
IntPtr image, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes,
- StreamSeekDelegate doSeek, StreamCloseDelegate close,
StreamSizeDelegate size, ref Guid encoderClsID, IntPtr encoderParameters );
-
+ static internal extern Status GdipSaveImageToDelegate_linux
(IntPtr image, StreamGetBytesDelegate getBytes,
+ StreamPutBytesDelegate putBytes, StreamSeekDelegate
doSeek, StreamCloseDelegate close,
+ StreamSizeDelegate size, ref Guid encoderClsID, IntPtr
encoderParameters);
+
+ [DllImport("gdiplus.dll")]
+ static internal extern Status
GdipCreateMetafileFromDelegate_linux (StreamGetHeaderDelegate getHeader,
+ StreamGetBytesDelegate getBytes, StreamPutBytesDelegate
putBytes, StreamSeekDelegate doSeek,
+ StreamCloseDelegate close, StreamSizeDelegate size, out
IntPtr metafile);
+
+ [DllImport("gdiplus.dll")]
+ static internal extern Status
GdipGetMetafileHeaderFromDelegate_linux (StreamGetHeaderDelegate getHeader,
+ StreamGetBytesDelegate getBytes, StreamPutBytesDelegate
putBytes, StreamSeekDelegate doSeek,
+ StreamCloseDelegate close, StreamSizeDelegate size,
IntPtr header);
#endregion
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches