C# Class NContrib.Drawing.ImageTypeHelper

Afficher le fichier Open project: veracross/ncontrib Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

GetImageEncoderFromMimeType() public static méthode

Gets the appropriate ImageCodecInfo based on a mime type
public static GetImageEncoderFromMimeType ( string mimeType ) : System.Drawing.Imaging.ImageCodecInfo
mimeType string
Résultat System.Drawing.Imaging.ImageCodecInfo

GetImageFormatFromMimeType() public static méthode

Get the appropriate ImageFormat for the specified mimeType using GetImageEncoderFromMimeType as a helper.
public static GetImageFormatFromMimeType ( string mimeType ) : ImageFormat
mimeType string
Résultat System.Drawing.Imaging.ImageFormat

IsBmp() public static méthode

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
Résultat bool

IsGif() public static méthode

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
Résultat bool

IsImageType() public static méthode

Detects if the image in the given stream is
public static IsImageType ( Stream stream, ImageFormat type ) : bool
stream Stream
type System.Drawing.Imaging.ImageFormat
Résultat bool

IsJpeg() public static méthode

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
Résultat bool

IsPng() public static méthode

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
Résultat bool