CGRect.Inflate Method

Definition

Overloads

Inflate(CGSize)

Enlarges this CGRect by the specified amount.

Inflate(Double, Double)

Increases the size of the rectangle by adding the specified amounts along both directions of each axis.

Inflate(nfloat, nfloat)

Enlarges this CGRect by the specified amount.

Inflate(Single, Single)
Inflate(CGRect, nfloat, nfloat)

Creates and returns an enlarged copy of the specified CGRect structure. The copy is enlarged by the specified amount. The original CGRect structure remains unmodified.

Inflate(CGSize)

Enlarges this CGRect by the specified amount.

public void Inflate (CoreGraphics.CGSize size);
member this.Inflate : CoreGraphics.CGSize -> unit

Parameters

size
CGSize

The amount to inflate this rectangle.

Remarks

This method enlarges this rectangle, not a copy of it. The rectangle is enlarged in both directions along an axis. For example, if a 50 by 50 rectangle is enlarged by 50 in the x-axis, the resultant rectangle will be 150 units long (the original 50, the 50 in the minus direction, and the 50 in the plus direction) maintaining the rectangle's geometric center.

If either x or y is negative, the CGRect structure is deflated in the corresponding direction.

Applies to

Inflate(Double, Double)

Increases the size of the rectangle by adding the specified amounts along both directions of each axis.

public void Inflate (double x, double y);
member this.Inflate : double * double -> unit

Parameters

x
Double

The amount to add to both horizontal sides.

y
Double

The amount to add to both vertical sides.

Remarks

Inflating a rectangle that is of size [1,1] and centered on [1,1] results in a rectangle of size [,3,3] centered on the same spot, since the x and y inflations are applied to all sides.

Applies to

Inflate(nfloat, nfloat)

Enlarges this CGRect by the specified amount.

public void Inflate (nfloat x, nfloat y);
member this.Inflate : nfloat * nfloat -> unit

Parameters

x
nfloat

Width to inflate by.

y
nfloat

Height to inflate by.

Remarks

This method enlarges this rectangle, not a copy of it. The rectangle is enlarged in both directions along an axis. For example, if a 50 by 50 rectangle is enlarged by 50 in the x-axis, the resultant rectangle will be 150 units long (the original 50, the 50 in the minus direction, and the 50 in the plus direction) maintaining the rectangle's geometric center.

If either x or y is negative, the CGRect structure is deflated in the corresponding direction.

Applies to

Inflate(Single, Single)

public void Inflate (float x, float y);
member this.Inflate : single * single -> unit

Parameters

x
Single
y
Single

Applies to

Inflate(CGRect, nfloat, nfloat)

Creates and returns an enlarged copy of the specified CGRect structure. The copy is enlarged by the specified amount. The original CGRect structure remains unmodified.

public static CoreGraphics.CGRect Inflate (CoreGraphics.CGRect rect, nfloat x, nfloat y);
static member Inflate : CoreGraphics.CGRect * nfloat * nfloat -> CoreGraphics.CGRect

Parameters

rect
CGRect

The CGRect with which to start. This rectangle is not modified.

x
nfloat

The amount to inflate this CGRect horizontally.

y
nfloat

The amount to inflate this CGRect vertically.

Returns

The enlarged CGRect.

Remarks

This method makes a copy of rect, enlarges the copy, and then returns the enlarged copy. The rectangle is enlarged in both directions along an axis. For example, if a 50 by 50 rectangle is enlarged by 50 in the x-axis, the resultant rectangle will be 150 units long (the original 50, the 50 in the minus direction, and the 50 in the plus direction) maintaining the rectangle's geometric center.

Applies to