Add two Rectangles - CSharp System

CSharp examples for System:Math Geometry

Description

Add two Rectangles

Demo Code


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);
        }
}

Related Tutorials