C# Class Glue.IO.ImageHeader

Taken from http://stackoverflow.com/questions/111345/getting-image-dimensions-without-reading-the-entire-file/111349 Minor improvements including supporting unsigned 16-bit integers when decoding Jfif and added logic to load the image using new Bitmap if reading the headers fails
Afficher le fichier Open project: vchelaru/FlatRedBall

Méthodes publiques

Méthode Description
GetDimensions ( BinaryReader binaryReader ) : Size

Gets the dimensions of an image.

GetDimensions ( string path ) : Size

Gets the dimensions of an image.

Private Methods

Méthode Description
DecodeBitmap ( BinaryReader binaryReader ) : Size
DecodeGif ( BinaryReader binaryReader ) : Size
DecodeJfif ( BinaryReader binaryReader ) : Size
DecodePng ( BinaryReader binaryReader ) : Size
ReadLittleEndianInt16 ( BinaryReader binaryReader ) : short
ReadLittleEndianInt32 ( BinaryReader binaryReader ) : int
ReadLittleEndianUInt16 ( BinaryReader binaryReader ) : ushort
StartsWith ( byte thisBytes, byte thatBytes ) : bool

Method Details

GetDimensions() public static méthode

Gets the dimensions of an image.
The image was of an unrecognised format.
public static GetDimensions ( BinaryReader binaryReader ) : Size
binaryReader System.IO.BinaryReader
Résultat System.Drawing.Size

GetDimensions() public static méthode

Gets the dimensions of an image.
The image was of an unrecognised format.
public static GetDimensions ( string path ) : Size
path string The path of the image to get the dimensions of.
Résultat System.Drawing.Size