WebImage.Resize Method

Resizes an image.

Namespace:  System.Web.Helpers
Assembly:  System.Web.Helpers (in System.Web.Helpers.dll)

public WebImage Resize(
	int width,
	int height,
	bool preserveAspectRatio,
	bool preventEnlarge
)

Parameters

width
Type: System.Int32
The width, in pixels, of the WebImage object.
height
Type: System.Int32
The height, in pixels, of the WebImage object.
preserveAspectRatio
Type: System.Boolean
true to preserve the aspect ratio of the image; otherwise, false.
preventEnlarge
Type: System.Boolean
true to prevent the enlargement of the image; otherwise, false.

Return Value

Type: System.Web.Helpers.WebImage
The resized image.

  • Medium trust for the immediate caller. This member can be used by partially trusted code.
Show: