Image decoder to decode different custom image file formats.

Namespace:  AForge.Imaging.Formats
Assembly:  AForge.Imaging.Formats (in AForge.Imaging.Formats.dll) Version: 2.2.4.0 (2.2.4.0)

Syntax

C#
public class ImageDecoder

Remarks

The class represent a help class, which simplifies decoding of image files finding appropriate image decoder automatically (using list of registered image decoders). Instead of using required image decoder directly, users may use this class, which will find required decoder by file's extension.

By default the class registers on its own all decoders, which are available in AForge.Imaging.Formats library. If user has implementation of his own image decoders, he needs to register them using RegisterDecoder(String, IImageDecoder) method to be able to use them through the ImageDecoder class.

Note:If the class can not find appropriate decode in the list of registered decoders, it passes file to .NET's image decoder for decoding.

Sample usage:

CopyC#
// sample file name
string fileName = "myFile.pnm";
// decode image file
Bitmap = ImageDecoder.DecodeFromFile( fileName );

Inheritance Hierarchy

System..::.Object
  AForge.Imaging.Formats..::.ImageDecoder

See Also