C# Class NContrib.Drawing.ImageSizeHelper

显示文件 Open project: veracross/ncontrib

Public Methods

Method Description
GetBmpImageSize ( Stream stream ) : Size

Reads the size of a BMP image from this stream at the current offset Rewinds the stream to where it started when finished

GetGifImageSize ( Stream stream ) : Size

Reads the size of a GIF image from this stream at the current offset Rewinds the stream to where it started when finished

GetImageSize ( Stream stream ) : Size

Tries to use the GNV fast image size checkers for JPEG, GIF, PNG, and BMP Uses .NET newing-up an Image object as a fallback

GetImageSize ( string imagePath ) : Size

Tries to use the GNV fast image size checkers for JPEG, GIF, PNG, and BMP Uses .NET newing-up an Image object as a fallback

GetJpegImageSize ( Stream stream ) : Size

Reads a JPEG image's dimensions and returns a Size object. Much faster than using the built in System.Drawing.Image class which loads the entire image into memory Rewinds the stream after reading.

GetPngImageSize ( Stream stream ) : Size

Reads the size of a PNG image from this stream at the current offset Rewinds the stream to where it started when finished

Method Details

GetBmpImageSize() public static method

Reads the size of a BMP image from this stream at the current offset Rewinds the stream to where it started when finished
public static GetBmpImageSize ( Stream stream ) : Size
stream Stream
return System.Drawing.Size

GetGifImageSize() public static method

Reads the size of a GIF image from this stream at the current offset Rewinds the stream to where it started when finished
public static GetGifImageSize ( Stream stream ) : Size
stream Stream
return System.Drawing.Size

GetImageSize() public static method

Tries to use the GNV fast image size checkers for JPEG, GIF, PNG, and BMP Uses .NET newing-up an Image object as a fallback
public static GetImageSize ( Stream stream ) : Size
stream Stream
return System.Drawing.Size

GetImageSize() public static method

Tries to use the GNV fast image size checkers for JPEG, GIF, PNG, and BMP Uses .NET newing-up an Image object as a fallback
public static GetImageSize ( string imagePath ) : Size
imagePath string
return System.Drawing.Size

GetJpegImageSize() public static method

Reads a JPEG image's dimensions and returns a Size object. Much faster than using the built in System.Drawing.Image class which loads the entire image into memory Rewinds the stream after reading.
Thrown when the Stream is not a JPEG image
public static GetJpegImageSize ( Stream stream ) : Size
stream Stream
return System.Drawing.Size

GetPngImageSize() public static method

Reads the size of a PNG image from this stream at the current offset Rewinds the stream to where it started when finished
public static GetPngImageSize ( Stream stream ) : Size
stream Stream
return System.Drawing.Size