RectangleF::Inflate Method (RectangleF, Single, Single)

 

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

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public:
static RectangleF Inflate(
	RectangleF rect,
	float x,
	float y
)

Parameters

rect
Type: System.Drawing::RectangleF

The RectangleF to be copied. This rectangle is not modified.

x
Type: System::Single

The amount to enlarge the copy of the rectangle horizontally.

y
Type: System::Single

The amount to enlarge the copy of the rectangle vertically.

Return Value

Type: System.Drawing::RectangleF

The enlarged RectangleF.

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 inflated 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.

.NET Framework
Available since 1.1
Return to top
Show: