C# Class Rock.Utility.ImageUtilities

显示文件 Open project: NewSpring/Rock

Public Methods

Method Description
GetFileContentStream ( System.Web.HttpPostedFile uploadedFile, bool enableResize, bool errorIfNotImage = false ) : Stream

Gets the file bytes.

Private Methods

Method Description
ContentTypeToImageFormat ( string contentType ) : ImageFormat

Returns the ImageFormat for the given ContentType string. Throws NotSupportedException if given an unknown/unsupported content type.

OrientationToFlipType ( string orientation ) : RotateFlipType

Orientations the type of to flip.

ResizeImage ( Image imgToResize, Size size ) : Image

Resizes the image.

RoughResize ( Bitmap input, int maxWidth, int maxHeight ) : Bitmap

Roughes the resize.

Method Details

GetFileContentStream() public static method

Gets the file bytes.
public static GetFileContentStream ( System.Web.HttpPostedFile uploadedFile, bool enableResize, bool errorIfNotImage = false ) : Stream
uploadedFile System.Web.HttpPostedFile The uploaded file.
enableResize bool
errorIfNotImage bool
return Stream