GetImageCodecInfo

public static ImageCodecInfo GetImageCodecInfo(this ImageFormat imageFormat)
{
	if(imageFormat == null)
		throw new ArgumentNullException("imageFormat");

	return ImageCodecInfo.GetImageEncoders().FirstOrDefault(i => i.Clsid == imageFormat.Guid);
}
Example:
ImageCodecInfo codec = ImageFormat.Png.GetImageCodecInfo();

Description

Gets the ImageCodecInfo that corresponds to a ImageFormat.

Details

Double click on the code to select all.

 

;