public static Inflate ( |
||
rect | ||
size | ||
return |
Rect originalRect = new Rect(0, 0, 100, 100); double padding = 10; Rect inflatedRect = originalRect.Inflate(padding, padding); // Result: inflatedRect = new Rect(-10, -10, 120, 120)In this example, we create a Rect object with a size of 100x100 and add a padding of 10 units to each side. The resulting inflated rectangle is -10,-10,120,120. Package library: This method is part of the System.Windows library, which is included in the .NET Framework.