CSharp examples for System:Math Geometry
Add two Rectangles
using System.Windows.Forms; using System.Drawing; public class Main{ public static Rectangle Add(Rectangle rect, Padding padding) {/* www . j a v a 2 s. com*/ return new Rectangle(rect.Left - padding.Left, rect.Top - padding.Top, rect.Width + padding.Horizontal, rect.Height + padding.Vertical); } }