/// <summary> /// Creates and returns an enlarged copy of the specified Rectangle structure. /// The copy is enlarged by the specified amount. /// The original Rectangle structure remains unmodified. /// </summary> /// <param name="rect">The Rectangle with which to start. This rectangle is not modified.</param> /// <param name="x">The amount to inflate this rectangle horizontally.</param> /// <param name="y">The amount to inflate this rectangle vertically.</param> /// <returns>The enlarged rectangle.</returns> public static Rectangle Inflate(Rectangle rect, int x, int y) { Rectangle r = new Rectangle(rect.Location, rect.Size); r.Inflate(x, y); return r; }