C# Class ImageResizer.FluentExtensions.ResizeExpression

As expression for configuring image resize options
Inheritance: ImageUrlBuilderExpression
Show file Open project: benfoster/ImageResizer.FluentExtensions

Public Methods

Method Description
Crop ( ) : AlignmentExpression

Sets the fit mode to Crop

Dimensions ( int width, int height ) : ResizeExpression

Sets the width and height of the image. Adds whitespace and centers to maintain aspect ratio

Height ( int height ) : ResizeExpression

Sets the height of the image. Aspect ratio is maintained by default.

Max ( ) : ResizeExpression

Sets the fit mode to Max - behaves like maxwidth/maxheight

MaxHeight ( int maxHeight ) : ResizeExpression

Sets the maxiumum height of the image. Maintains aspect ratio but does not add padding.

MaxWidth ( int maxWidth ) : ResizeExpression

Sets the maxiumum width of the image. Maintains aspect ratio but does not add padding.

Pad ( ) : AlignmentExpression

Sets the fit mode to Pad - adds whitespace to resolve aspect-ratio conflicts

ScaleBoth ( ) : ResizeExpression

Allows scaling up and down

ScaleCanvas ( ) : AlignmentExpression

Scales the image down and adds a margin to scale up

ScaleDown ( ) : ResizeExpression

Allows scaling down of the image (default)

ScaleUp ( ) : ResizeExpression

Allows scaling up of the image

Stretch ( ) : ResizeExpression

Sets the fit mode to Stretch. Stretches the image, losing aspect ratio

Width ( int width ) : ResizeExpression

Sets the width of the image. Aspect ratio is maintained by default.

Zoom ( decimal multiplier ) : ResizeExpression

cale the image by a multiplier. Defaults to 1. 0.5 produces a half-size image, 2 produces a double-size image.

Private Methods

Method Description
ResizeExpression ( ImageUrlBuilder builder ) : System

Method Details

Crop() public method

Sets the fit mode to Crop
public Crop ( ) : AlignmentExpression
return AlignmentExpression

Dimensions() public method

Sets the width and height of the image. Adds whitespace and centers to maintain aspect ratio
public Dimensions ( int width, int height ) : ResizeExpression
width int The desired width in pixels
height int The desired height in pixels
return ResizeExpression

Height() public method

Sets the height of the image. Aspect ratio is maintained by default.
public Height ( int height ) : ResizeExpression
height int The desired height in pixels
return ResizeExpression

Max() public method

Sets the fit mode to Max - behaves like maxwidth/maxheight
public Max ( ) : ResizeExpression
return ResizeExpression

MaxHeight() public method

Sets the maxiumum height of the image. Maintains aspect ratio but does not add padding.
public MaxHeight ( int maxHeight ) : ResizeExpression
maxHeight int
return ResizeExpression

MaxWidth() public method

Sets the maxiumum width of the image. Maintains aspect ratio but does not add padding.
public MaxWidth ( int maxWidth ) : ResizeExpression
maxWidth int The desired maxiumum width in pixels
return ResizeExpression

Pad() public method

Sets the fit mode to Pad - adds whitespace to resolve aspect-ratio conflicts
public Pad ( ) : AlignmentExpression
return AlignmentExpression

ScaleBoth() public method

Allows scaling up and down
public ScaleBoth ( ) : ResizeExpression
return ResizeExpression

ScaleCanvas() public method

Scales the image down and adds a margin to scale up
public ScaleCanvas ( ) : AlignmentExpression
return AlignmentExpression

ScaleDown() public method

Allows scaling down of the image (default)
public ScaleDown ( ) : ResizeExpression
return ResizeExpression

ScaleUp() public method

Allows scaling up of the image
public ScaleUp ( ) : ResizeExpression
return ResizeExpression

Stretch() public method

Sets the fit mode to Stretch. Stretches the image, losing aspect ratio
public Stretch ( ) : ResizeExpression
return ResizeExpression

Width() public method

Sets the width of the image. Aspect ratio is maintained by default.
public Width ( int width ) : ResizeExpression
width int The desired width in pixels
return ResizeExpression

Zoom() public method

cale the image by a multiplier. Defaults to 1. 0.5 produces a half-size image, 2 produces a double-size image.
public Zoom ( decimal multiplier ) : ResizeExpression
multiplier decimal
return ResizeExpression