Xamarin.Forms.Rectangle.Inflate Method
Creates a Xamarin.Forms.Rectangle whose borders are inflated in every direction.

Syntax

public Rectangle Inflate (double width, double height)

Parameters

width
Value to shift Rectangle.Left to the left and Rectangle.Right to the right.
height
Value to shift Rectangle.Top upward and Rectangle.Bottom downward.

Returns

A new Xamarin.Forms.Rectangle whose Rectangle.Left and Rectangle.Right are inflated by width and whose Rectangle.Top and Rectangle.Bottom are inflated by height.

Remarks

Application developers should note that since the inflation occurs in every direction, the returned Xamarin.Forms.Rectangle is larger in X by twice width and larger in Y by twice height.

C# Example

var rect = new Rectangle (10, 10, 5, 5);
var larger = rect.Inflate (1,1);
Assert.AreEqual (larger, new Rectangle (9, 9, 7, 7));

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0