C# Класс NContrib.Drawing.ImageTypeHelper

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
GetImageEncoderFromMimeType ( string mimeType ) : System.Drawing.Imaging.ImageCodecInfo

Gets the appropriate ImageCodecInfo based on a mime type

GetImageFormatFromMimeType ( string mimeType ) : ImageFormat

Get the appropriate ImageFormat for the specified mimeType using GetImageEncoderFromMimeType as a helper.

IsBmp ( Stream stream ) : bool

Looks for the BMP 2-byte leading signature at the current position in the stream. Rewinds the stream to its original position when finished.

IsGif ( Stream stream ) : bool

Looks for the GIF 6-byte leading signature and version the current position in the stream. Rewinds the stream to its original position when finished.

IsImageType ( Stream stream, ImageFormat type ) : bool

Detects if the image in the given stream is

IsJpeg ( Stream stream ) : bool

Looks for the JPEG 2-bytes leading signature at the current position in the stream Rewinds the stream to its original position when finished.

IsPng ( Stream stream ) : bool

Looks for the PNG 8-byte leading signature at the current position in the stream. Rewinds the stream to its original position when finished.

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

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

Gets the appropriate ImageCodecInfo based on a mime type
public static GetImageEncoderFromMimeType ( string mimeType ) : System.Drawing.Imaging.ImageCodecInfo
mimeType string
Результат System.Drawing.Imaging.ImageCodecInfo

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

Get the appropriate ImageFormat for the specified mimeType using GetImageEncoderFromMimeType as a helper.
public static GetImageFormatFromMimeType ( string mimeType ) : ImageFormat
mimeType string
Результат System.Drawing.Imaging.ImageFormat

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

Looks for the BMP 2-byte leading signature at the current position in the stream. Rewinds the stream to its original position when finished.
public static IsBmp ( Stream stream ) : bool
stream Stream
Результат bool

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

Looks for the GIF 6-byte leading signature and version the current position in the stream. Rewinds the stream to its original position when finished.
public static IsGif ( Stream stream ) : bool
stream Stream
Результат bool

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

Detects if the image in the given stream is
public static IsImageType ( Stream stream, ImageFormat type ) : bool
stream Stream
type System.Drawing.Imaging.ImageFormat
Результат bool

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

Looks for the JPEG 2-bytes leading signature at the current position in the stream Rewinds the stream to its original position when finished.
public static IsJpeg ( Stream stream ) : bool
stream Stream
Результат bool

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

Looks for the PNG 8-byte leading signature at the current position in the stream. Rewinds the stream to its original position when finished.
public static IsPng ( Stream stream ) : bool
stream Stream
Результат bool