Rectangle.Inflate Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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));