Class ImageFormatManager
- Namespace
- SixLabors.ImageSharp.Formats
- Assembly
- SixLabors.ImageSharp.dll
Collection of Image Formats to be used in Configuration class.
public class ImageFormatManager
- Inheritance
-
ImageFormatManager
- Inherited Members
Constructors
ImageFormatManager()
Initializes a new instance of the ImageFormatManager class.
public ImageFormatManager()
Properties
ImageFormats
Gets the currently registered IImageFormats.
public IEnumerable<IImageFormat> ImageFormats { get; }
Property Value
Methods
AddImageFormat(IImageFormat)
Registers a new format provider.
public void AddImageFormat(IImageFormat format)
Parameters
formatIImageFormatThe format to register as a known format.
AddImageFormatDetector(IImageFormatDetector)
Adds a new detector for detecting mime types.
public void AddImageFormatDetector(IImageFormatDetector detector)
Parameters
detectorIImageFormatDetectorThe detector to add
ClearImageFormatDetectors()
Removes all the registered image format detectors.
public void ClearImageFormatDetectors()
GetDecoder(IImageFormat)
For the specified mime type find the decoder.
public IImageDecoder GetDecoder(IImageFormat format)
Parameters
formatIImageFormatThe format to discover
Returns
Exceptions
- UnknownImageFormatException
The format is not registered.
GetEncoder(IImageFormat)
For the specified mime type find the encoder.
public IImageEncoder GetEncoder(IImageFormat format)
Parameters
formatIImageFormatThe format to discover
Returns
Exceptions
- UnknownImageFormatException
The format is not registered.
SetDecoder(IImageFormat, IImageDecoder)
Sets a specific image decoder as the decoder for a specific image format.
public void SetDecoder(IImageFormat imageFormat, IImageDecoder decoder)
Parameters
imageFormatIImageFormatThe image format to register the encoder for.
decoderIImageDecoderThe decoder to use,
SetEncoder(IImageFormat, IImageEncoder)
Sets a specific image encoder as the encoder for a specific image format.
public void SetEncoder(IImageFormat imageFormat, IImageEncoder encoder)
Parameters
imageFormatIImageFormatThe image format to register the encoder for.
encoderIImageEncoderThe encoder to use,
TryFindFormatByFileExtension(string, out IImageFormat?)
For the specified file extensions type find the e IImageFormat.
public bool TryFindFormatByFileExtension(string extension, out IImageFormat? format)
Parameters
extensionstringThe extension to return the format for.
formatIImageFormatWhen this method returns, contains the format that matches the given extension; otherwise, the default value for the type of the
formatparameter. This parameter is passed uninitialized.
Returns
TryFindFormatByMimeType(string, out IImageFormat?)
For the specified mime type find the IImageFormat.
public bool TryFindFormatByMimeType(string mimeType, out IImageFormat? format)
Parameters
mimeTypestringThe mime-type to return the format for.
formatIImageFormatWhen this method returns, contains the format that matches the given mime-type; otherwise, the default value for the type of the
formatparameter. This parameter is passed uninitialized.