C# Класс 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
Показать файл Открыть проект

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

Метод Описание
GetDimensions ( BinaryReader binaryReader ) : Size

Gets the dimensions of an image.

GetDimensions ( string path ) : Size

Gets the dimensions of an image.

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

Метод Описание
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

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

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

Gets the dimensions of an image.
The image was of an unrecognised format.
public static GetDimensions ( BinaryReader binaryReader ) : Size
binaryReader System.IO.BinaryReader
Результат System.Drawing.Size

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

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.
Результат System.Drawing.Size