Is there quick way to get the ImageFormat object associated to a particular file extension? I\'m looking for quicker than string comparisons for each format.
private static ImageFormat GetImageFormat(string format) { ImageFormat imageFormat = null; try { var imageFormatConverter = new ImageFormatConverter(); imageFormat = (ImageFormat)imageFormatConverter.ConvertFromString(format); } catch (Exception) { throw; } return imageFormat; }