Jelajahi Sumber

* GraphicsPath.cs (AddCurve, AddClosedCurve): Added all overloads.

* Graphics.cs (DrawCurve): Call the correct GDI+ wrappers.

* gdipFunctions.cs (GdipAddPathCurveI):
(GdipAddPathCurve2, GdipAddPathCurve2I):
(GdipAddPathCurve3, GdipAddPathCurve3I):
(GdipAddPathClosedCurve, GdipAddPathClosedCurveI):
(GdipAddPathClosedCurve2, GdipAddPathClosedCurve2I): Added new
wrappers from GDI+.

svn path=/trunk/mcs/; revision=24936
Duncan Mak 22 tahun lalu
induk
melakukan
e052b7bdd0

+ 4 - 0
mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog

@@ -1,3 +1,7 @@
+2004-04-01  Duncan Mak  <[email protected]>
+
+	* GraphicsPath.cs (AddCurve, AddClosedCurve): Added all overloads.
+
 2004-03-26  Ravindra  <[email protected]>
 	* WrapMode.cs: Corrected the TileFlipXY and TileFlipY values.
 

+ 58 - 0
mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.cs

@@ -334,6 +334,64 @@ namespace System.Drawing.Drawing2D
                         return pt;
                 }
 
+                //
+                // AddClosedCurve
+                //
+                public void AddClosedCurve (Point [] points)
+                {
+                        GDIPlus.GdipAddPathClosedCurveI (nativePath, points, points.Length);
+                }
+
+                public void AddClosedCurve (PointF [] points)
+                {
+                        GDIPlus.GdipAddPathClosedCurve (nativePath, points, points.Length);
+                }
+
+                public void AddClosedCurve (Point [] points, float tension)
+                {
+                        GDIPlus.GdipAddPathClosedCurve2I (nativePath, points, points.Length, tension);
+                }
+
+                public void AddClosedCurve (PointF [] points, float tension)
+                {
+                        GDIPlus.GdipAddPathClosedCurve2 (nativePath, points, points.Length, tension);
+                }
+
+                //
+                // AddCurve
+                //
+                public void AddCurve (Point [] points)
+                {
+                        GDIPlus.GdipAddPathCurveI (nativePath, points, points.Length);
+                }
+                
+                public void AddCurve (PointF [] points)
+                {
+                        GDIPlus.GdipAddPathCurve (nativePath, points, points.Length);
+                }
+                
+                public void AddCurve (Point [] points, float tension)
+                {
+                        GDIPlus.GdipAddPathCurve2I (nativePath, points, points.Length, tension);
+                }
+                
+                public void AddCurve (PointF [] points, float tension)
+                {
+                        GDIPlus.GdipAddPathCurve2 (nativePath, points, points.Length, tension);
+                }
+
+                public void AddCurve (Point [] points, int offset, int numberOfSegments, float tension)
+                {
+                        GDIPlus.GdipAddPathCurve3I (nativePath, points, points.Length,
+                                        offset, numberOfSegments, tension);
+                }
+                
+                public void AddCurve (PointF [] points, int offset, int numberOfSegments, float tension)
+                {
+                        GDIPlus.GdipAddPathCurve3 (nativePath, points, points.Length,
+                                        offset, numberOfSegments, tension);
+                }
+                        
                 public void Reset ()
                 {
                         GDIPlus.GdipResetPath (nativePath);

+ 11 - 0
mcs/class/System.Drawing/System.Drawing/ChangeLog

@@ -1,3 +1,14 @@
+2004-04-01  Duncan Mak  <[email protected]>
+
+	* Graphics.cs (DrawCurve): Call the correct GDI+ wrappers.
+
+	* gdipFunctions.cs (GdipAddPathCurveI):
+	(GdipAddPathCurve2, GdipAddPathCurve2I):
+	(GdipAddPathCurve3, GdipAddPathCurve3I):
+	(GdipAddPathClosedCurve, GdipAddPathClosedCurveI):
+	(GdipAddPathClosedCurve2, GdipAddPathClosedCurve2I): Added new
+	wrappers from GDI+.
+
 2004-03-30  Jordi Mas i Hernandez <[email protected]>	
 	* Image.cs: implemented a few GDI+ wrapper calls
 2004-03-30  Jordi Mas i Hernandez <[email protected]>

+ 3 - 5
mcs/class/System.Drawing/System.Drawing/Graphics.cs

@@ -228,19 +228,17 @@ namespace System.Drawing
 		
 		public void DrawCurve (Pen pen, Point [] points)
 		{
-			GDIPlus.GdipDrawCurveI (nativeObject, pen.nativeObject, points, points.Length);	 		
+			GDIPlus.GdipDrawCurveI (nativeObject, pen.nativeObject, points, points.Length);
 		}
 		
 		public void DrawCurve (Pen pen, PointF [] points)
 		{
-			GDIPlus.GdipDrawCurve (nativeObject, pen.nativeObject, points, points.Length); 				
-			
+			GDIPlus.GdipDrawCurve (nativeObject, pen.nativeObject, points, points.Length);
 		}
 		
 		public void DrawCurve (Pen pen, PointF [] points, float tension)
 		{			
-			GDIPlus.GdipDrawCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension); 		
-			
+			GDIPlus.GdipDrawCurve2 (nativeObject, pen.nativeObject, points, points.Length, tension);
 		}
 		
 		public void DrawCurve (Pen pen, Point [] points, float tension)

+ 18 - 0
mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs

@@ -919,6 +919,24 @@ namespace System.Drawing {
                 [DllImport ("gdiplus.dll")]                                                                
                 internal static extern Status GdipAddPathCurve (IntPtr path, PointF [] points, int count);
                 [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathCurveI (IntPtr path, Point [] points, int count);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathCurve2 (IntPtr path, PointF [] points, int count, float tension);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathCurve2I (IntPtr path, Point [] points, int count, float tension);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathCurve3 (IntPtr path, PointF [] points, int count, int offset, int numberOfSegments, float tension);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathCurve3I (IntPtr path, Point [] points, int count, int offset, int numberOfSegments, float tension);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathClosedCurve (IntPtr path, PointF [] points, int count);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathClosedCurveI (IntPtr path, Point [] points, int count);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathClosedCurve2 (IntPtr path, PointF [] points, int count, float tension);
+                [DllImport ("gdiplus.dll")]                                                                
+                internal static extern Status GdipAddPathClosedCurve2I (IntPtr path, Point [] points, int count, float tension);
+                [DllImport ("gdiplus.dll")]                                                                
                 internal static extern Status GdipAddPathRectangle (IntPtr path, float x, float y, float width, float height);
                 [DllImport ("gdiplus.dll")]                                                                
                 internal static extern Status GdipAddPathRectangles (IntPtr path, RectangleF [] rects, int count);