Hello,
Welcome to our Microsoft Q&A platform!
The thumbnail is part of the file, and does not have an independent file path, so if you need to display the thumbnail of the music file on the tile, then you need to save the thumbnail to the local and use the local path.
This is a way to read thumbnails and exist locally:
private async Task<string> SaveThumbnailToLocal(string fileName, StorageItemThumbnail thumbnail)
{
var localFolder = ApplicationData.Current.LocalFolder;
var tempFile = await localFolder.CreateFileAsync(fileName,CreationCollisionOption.OpenIfExists);
using (var thumbStream = thumbnail.AsStreamForRead())
using (var fileStream = await tempFile.OpenStreamForWriteAsync())
{
await thumbStream.CopyToAsync(fileStream);
}
return $"ms-appdata:///local/{fileName}";
}
Use
StorageItemThumbnail thumbnail = await file.GetThumbnailAsync(ThumbnailMode.MusicView);
string imagePath = await SaveThumbnailToLocal("temp.png", thumbnail);
// do other things
ms-appdata is a special scheme, it is used to read the files in the application local, roaming or temporary folders, which are related document.
Thanks.