This project has moved and is read-only. For the latest updates, please go here.

IFileDialogService - Multiple file filters

Apr 24, 2012 at 9:12 PM


I want to select an image through the IFileDialogService but I want to display images for all image formats.

I don't want that user must change the filter to png or the jpg. The current code requires that the user must change the filter in order to see the different image files:

            supportedImageTypes.Add(new FileType("PNG",".jpg"));
            supportedImageTypes.Add(new FileType("JPG", ".jpg"));

Can this be done?



Apr 25, 2012 at 2:25 AM


public static FileType[] ImageFilterFiles
                return new FileType[]
                    new FileType("All Image format", ".BMP;*.JPG;*.GIF;*.JPEG;*.JPE;*.JFIF;*.GIF;*.PNG;*.TIF;*.TIFF;*.ICO"),
                    new FileType("Bitmap(*.bmp)", ".BMP;*.bmp"),
                    new FileType("Jpeg(*.jpeg,*.jpe, *.jfif, *.jpg)", ".JPG;*.JPEG;*.JPE;*.JFIF"),
                    new FileType("TIF(*.tif)", ".TIF;*.TIFF"),
                    new FileType("GIF(*.gif)", ".GIF"),
                    new FileType("PNG(*.png)", ".PNG"),
                    new FileType("ICO(*.ico)", ".ICO"),
                    new FileType("All files(*.*)", ".*")