public static ImageEncoder GetImageEncoder(int filterIndex) { // This needs to be decremented since File Dialog filters are 1 indexed filterIndex--; if (filterIndex < 0 || filterIndex >= _encoderImageFormats.Count) { return(null); } ImageFormatInformation info = (ImageFormatInformation)_encoderImageFormats[filterIndex]; return(info.Encoder); }
public static ImageEncoder GetImageEncoder(int filterIndex) { // FilterIndex is 1-indexed so decrement it before using filterIndex--; if (filterIndex < 0 || filterIndex >= _encoderImageFormats.Count) { return(null); } ImageFormatInformation info = (ImageFormatInformation)_encoderImageFormats[filterIndex]; return(info.Encoder); }