コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }