Rectangle.Inflate Method

Definition

Overloads

Inflate(Size)

Creates a Rectangle whose borders are inflated in every direction.

Inflate(Double, Double)

Creates a Rectangle whose borders are inflated in every direction.

Inflate(Size)

Creates a Rectangle whose borders are inflated in every direction.

public Xamarin.Forms.Rectangle Inflate (Xamarin.Forms.Size sz);
member this.Inflate : Xamarin.Forms.Size -> Xamarin.Forms.Rectangle

Parameters

sz
Size

Values to inflate all the borders.

Returns

A new Rectangle whose Left and Right are inflated by sz's Width and whose Top and Bottom are inflated by sz's Height.

Remarks

Application developers should note that since the inflation occurs in every direction, the returned Rectangle is larger in each dimension by twice sz.

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

Applies to

Inflate(Double, Double)

Creates a Rectangle whose borders are inflated in every direction.

public Xamarin.Forms.Rectangle Inflate (double width, double height);
member this.Inflate : double * double -> Xamarin.Forms.Rectangle

Parameters

width
Double

Value to shift Left to the left and Right to the right.

height
Double

Value to shift Top upward and Bottom downward.

Returns

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

Remarks

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

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

Applies to