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

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

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

Метод Описание
GetScaledImage ( this source, Size size ) : Image

Scales an image to within the specified dimensions, disregarding aspect ratio. To preserve aspect ratio, generate the size parameter using the Constrain, Scale, and Expand methods

GetScaledImage ( this source, int width, int height ) : Image

Scales an image to within the specified dimensions, disregarding aspect ratio

GetSquareImage ( this image ) : Image

Crops an image to make it square

SaveJpegWithCompressionSetting ( this img, Stream outputStream, long compression ) : void

Saves an Image as a JPEG to the given stream using a 1 - 100 compression level

SaveJpegWithCompressionSetting ( this img, string fileName, int compression ) : void

Saves an Image as a JPEG image to the given path using a 1 - 100 compression level

Приватные методы

Метод Описание
SetGraphicsDefaults ( this g ) : void

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

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

Scales an image to within the specified dimensions, disregarding aspect ratio. To preserve aspect ratio, generate the size parameter using the Constrain, Scale, and Expand methods
public static GetScaledImage ( this source, Size size ) : Image
source this
size System.Drawing.Size New size to scale to. Consider using the Constrain, Scale, and Expand methods to generate this value
Результат System.Drawing.Image

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

Scales an image to within the specified dimensions, disregarding aspect ratio
public static GetScaledImage ( this source, int width, int height ) : Image
source this
width int
height int
Результат System.Drawing.Image

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

Crops an image to make it square
public static GetSquareImage ( this image ) : Image
image this
Результат System.Drawing.Image

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

Saves an Image as a JPEG to the given stream using a 1 - 100 compression level
public static SaveJpegWithCompressionSetting ( this img, Stream outputStream, long compression ) : void
img this
outputStream System.IO.Stream
compression long
Результат void

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

Saves an Image as a JPEG image to the given path using a 1 - 100 compression level
public static SaveJpegWithCompressionSetting ( this img, string fileName, int compression ) : void
img this
fileName string
compression int
Результат void