Bitmap.cs: Move LockBits validations into unmanaged code.
[mono.git] / mcs / class / System.Drawing / System.Drawing / Size.cs
index 54a7bf0500483a6182a3d462a83eddeb90e32aa3..fb763d6869e3a03c20ecc8d4cb80de4eb47af472 100644 (file)
@@ -8,6 +8,29 @@
 // Copyright (C) 2004 Novell, Inc. http://www.novell.com
 //
 
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
 using System;
 using System.Runtime.Serialization;
 using System.Runtime.InteropServices;
@@ -314,5 +337,20 @@ namespace System.Drawing
                        return String.Format ("{{Width={0}, Height={1}}}", width, height);
                }
 
+#if NET_2_0
+               public static Size Add (Size sz1, Size sz2)
+               {
+                       return new Size (sz1.Width + sz2.Width, 
+                                        sz1.Height + sz2.Height);
+
+               }
+               
+               public static Size Subtract (Size sz1, Size sz2)
+               {
+                       return new Size (sz1.Width - sz2.Width, 
+                                        sz1.Height - sz2.Height);
+               }
+#endif
+
        }
 }