C# Class Imgix_Dotnet.Rectangle

A rectangle represented by a Width and a Height
显示文件 Open project: estei/Imgix-Dotnet Class Usage Examples

Public Methods

Method Description
CanHold ( Rectangle subject ) : bool

Can this rectangle hold the subject rectangle

EnsureFit ( Rectangle target ) : Rectangle

Resizes this rectangle to fit inside a target rectangle

Match ( Rectangle target ) : Rectangle

Resizes the rectangle to match the target rectangle on the shortest side

Ratio ( Rectangle target ) : double

The ratio between this rectangle and a target rectangle

Rectangle ( int width, int height ) : System

Initializes a new Rectangle object with a set width and height

Resize ( double ratio ) : Rectangle

Resizes this rectangle by a ratio

Method Details

CanHold() public method

Can this rectangle hold the subject rectangle
public CanHold ( Rectangle subject ) : bool
subject Rectangle The rectangle to compare to
return bool

EnsureFit() public method

Resizes this rectangle to fit inside a target rectangle
public EnsureFit ( Rectangle target ) : Rectangle
target Rectangle The target rectangle
return Rectangle

Match() public method

Resizes the rectangle to match the target rectangle on the shortest side
public Match ( Rectangle target ) : Rectangle
target Rectangle The target rectangle
return Rectangle

Ratio() public method

The ratio between this rectangle and a target rectangle
public Ratio ( Rectangle target ) : double
target Rectangle The rectangle to compare to
return double

Rectangle() public method

Initializes a new Rectangle object with a set width and height
public Rectangle ( int width, int height ) : System
width int The width
height int The height
return System

Resize() public method

Resizes this rectangle by a ratio
public Resize ( double ratio ) : Rectangle
ratio double The ratio to resize the rectangle by
return Rectangle