Click or drag to resize
ImageHelper.EnsureImageDimensions Method (Int32, Int32, Int32, Int32, Int32)
Computes new image dimensions according to the specified parameters, and returns it.

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 13.0.131
Syntax
C#
public static int[] EnsureImageDimensions(
	int width,
	int height,
	int maxSideSize,
	int imageWidth,
	int imageHeight
)

Parameters

width
Type: System.Int32
Required image width (optional)
height
Type: System.Int32
Required image height (optional)
maxSideSize
Type: System.Int32
Required max image size (overrides both required width and height, optional)
imageWidth
Type: System.Int32
Image width (required)
imageHeight
Type: System.Int32
Image height (required)

Return Value

Type:Int32[]
An array with computed width ([0]) and height ([1])
Remarks
This method prevents image enlargement. Both image width and image height must be positive integers, otherwise specified image dimensions are returned. Specified image dimensions are also returned when neither width, height or maxSideSize is a positive integer.
See Also