Click or drag to resize
SizeConstraintMaxWidthOrHeight Method
Creates a new size constraint that makes the image resize to the width and height that do not exceed the specified value. This constraint maintains the aspect ratio. The resized image is never made larger than the original.

Namespace: Kentico.Content.Web.Mvc
Assembly: Kentico.Content.Web.Mvc (in Kentico.Content.Web.Mvc.dll) Version: 13.0.131
Syntax
C#
public static SizeConstraint MaxWidthOrHeight(
	int maxWidthOrHeight
)

Parameters

maxWidthOrHeight
Type: SystemInt32
Maximum width or height of the resized image.

Return Value

Type: SizeConstraint
The new size constraint that makes the image resize to the width and height that do not exceed the specified value.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionMaximum width or height is less than or equal to 0.
See Also