C# Class UCosmic.Web.Mvc.ImageResizer

Datei anzeigen Open project: ucosmic/UCosmicAlpha

Public Methods

Method Description
ResizeImage ( this imageContent, ImageResizeRequestModel resizeParameters ) : Stream
ResizeImageConstrained ( this inSourceImage, int inDestCanvasWidth, int inDestCanvasHeight, ImageFormat inToFormat ) : MemoryStream

Private Methods

Method Description
GetAspectRatio ( this size ) : double
GetMaxHeight ( this request, Size originalSize ) : double
GetMaxWidth ( this request, Size originalSize ) : double
GetQuality ( this request ) : ImageResizeQuality
GetTargetSize ( this request, Size originalSize ) : Size
ReduceByHeight ( this originalSize, double maxHeight ) : Size
ReduceByWidth ( this originalSize, double maxWidth ) : Size

Method Details

ResizeImage() public static method

public static ResizeImage ( this imageContent, ImageResizeRequestModel resizeParameters ) : Stream
imageContent this
resizeParameters UCosmic.Web.Mvc.Models.ImageResizeRequestModel
return Stream

ResizeImageConstrained() public static method

public static ResizeImageConstrained ( this inSourceImage, int inDestCanvasWidth, int inDestCanvasHeight, ImageFormat inToFormat ) : MemoryStream
inSourceImage this
inDestCanvasWidth int
inDestCanvasHeight int
inToFormat System.Drawing.Imaging.ImageFormat
return System.IO.MemoryStream