How to detect if a StorageFile is of image type? RRS feed

  • Question

  • Hi, when I get files from "KnownFolders.PicturesLibrary" like

    IReadOnlyList<IStorageFile> pictureFiles = await KnownFolders.PicturesLibrary.GetFilesAsync();
    is there a way to detect if the StorageFile is indeed of image type.  Looks like I can check the "StorageFile.FileType" string value against a list of image file extensions, like ".png", ".jpg", .... 

    Is this the only way?

    Tuesday, April 29, 2014 10:22 PM