Resizes an image, maintaining width:height ratios.

Namespace: System.Extensions.Drawing
Assembly: System.Extensions (in System.Extensions.dll) Version: 0.0.0.5 (0.0.0.5)

Syntax

C#
public static Image Resize(
	this Image image,
	int width,
	int height,
	bool pad
)
Visual Basic
<ExtensionAttribute> 
Public Shared Function Resize ( 
	image As Image,
	width As Integer,
	height As Integer,
	pad As Boolean
) As Image
Visual C++
public:
[ExtensionAttribute]
static Image^ Resize(
	Image^ image, 
	int width, 
	int height, 
	bool pad
)
F#
static member Resize : 
        image : Image * 
        width : int * 
        height : int * 
        pad : bool -> Image 

Parameters

image
Type: System.Drawing..::..Image
The Image that you wish to resize.
width
Type: System..::..Int32
The desired width of the resulting image.
height
Type: System..::..Int32
The desired height of the resulting image.
pad
Type: System..::..Boolean
Whether the image should pad the borders to keep width/height.

Return Value

Type: Image
The resulting resized Image object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Image. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also