Constrain

Constrains the current image, resizing it to fit within the given dimensions whilst keeping its aspect ratio. Produces the same output as the Resize method using ResizeMode.Max

public ImageFactory Constrain(Size size)
    

Parameters

size
The System.Drawing.Size containing the maximum width and height to set the image to.

Examples

Original

original image

Constrain

Image resized to fit the aspect ratio.