C# Класс NContrib.Drawing.Extensions.SizeExtensions

Показать файл Открыть проект

Открытые методы

Метод Описание
CropToAspect ( this sourceSize, float aspect ) : Size

Returns a Size that is a sub-section of the given source size and conforms to the specified aspect

Expand ( this sourceSize, int width, int height, ScaleMethod method ) : Size

Scales an image Size, but only up

Scale ( this sourceSize, float scalePercent ) : Size

Calculates a scaled image size, changing the size by a percentage

Scale ( this sourceSize, int width, int height, ScaleMethod method, ScaleType type ) : Size

Scales an image size, preserving aspect ratio.

Shrink ( this sourceSize, int width, int height, ScaleMethod method ) : Size

Scales an image Size, but only down

Описание методов

CropToAspect() публичный статический Метод

Returns a Size that is a sub-section of the given source size and conforms to the specified aspect
public static CropToAspect ( this sourceSize, float aspect ) : Size
sourceSize this
aspect float
Результат System.Drawing.Size

Expand() публичный статический Метод

Scales an image Size, but only up
public static Expand ( this sourceSize, int width, int height, ScaleMethod method ) : Size
sourceSize this
width int
height int
method ScaleMethod
Результат System.Drawing.Size

Scale() публичный статический Метод

Calculates a scaled image size, changing the size by a percentage
public static Scale ( this sourceSize, float scalePercent ) : Size
sourceSize this
scalePercent float Scale percentage. 1 = 100% which yields no change /// .5 = 50% which would reduce the height and width by half.
Результат System.Drawing.Size

Scale() публичный статический Метод

Scales an image size, preserving aspect ratio.
public static Scale ( this sourceSize, int width, int height, ScaleMethod method, ScaleType type ) : Size
sourceSize this
width int Min or max allowed width. Min/Max controlled by the method parameter
height int Min or max allowed height. Min/Max controlled by the method parameter
method ScaleMethod
type ScaleType
Результат System.Drawing.Size

Shrink() публичный статический Метод

Scales an image Size, but only down
public static Shrink ( this sourceSize, int width, int height, ScaleMethod method ) : Size
sourceSize this
width int
height int
method ScaleMethod
Результат System.Drawing.Size