c# - 为 Windows 应用商店应用获取 .mp3 文件中的 Albumart

标签 c# windows-8 windows-runtime microsoft-metro windows-store-apps

如何获取 mp3 文件中的 AlbumArt 图像?我正在使用 C# 开发 Windows 应用商店应用。

MusicProperties 类为我提供了专辑名称与艺术家名称的对比,但它无法为我提供专辑封面。

最佳答案

查看 MSDN 示例以显示任何文件的缩略图。它还包括如何检索专辑封面。

File and folder thumbnail sample

如果您想保存专辑封面,请查看 How to store save Thumbnail image in device in windows 8 metro apps c#

更新 1

MediaFileStorageFile . ImageControl<Image ... />

using (StorageItemThumbnail thumbnail = await MediaFile.GetThumbnailAsync(ThumbnailMode.MusicView, 300))
{
    if (thumbnail != null && thumbnail.Type == ThumbnailType.Image)
    {
        var bitmapImage = new BitmapImage();
        bitmapImage.SetSource(thumbnail);
        ImageControl.Source = bitmapImage;
    }
}

关于c# - 为 Windows 应用商店应用获取 .mp3 文件中的 Albumart,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18807320/

相关文章:

xamarin.ios - 将 Socket MvvmCross 包含在 PCL 中的最佳方式

c# - WinRT 应用程序 : ComboxBox and ListBox does not display anything when ItemsSource is List<Type>

c# - WPF - 通过事件命令

c# - 如何将字符串转换为 HTML 安全字符串

javascript - Typeahead 和服务器端 onTextChanged 事件未正确同步

c# - 在 WebApi 中如何在 Controller 类级别继承路由前缀?

xaml - 如何将富文本(FlowDocument?)从我的 View 模型绑定(bind)到 RichTextBlock?

android - 将数据从 Web View 传递到 native 应用程序(Windows、iOS 和 Android)的最佳方法

windows-8 - 为什么 Windows 应用商店应用程序要使用 WebSockets 而不是原始 TCP?

html - IE10/Windows 8 奇怪的轮廓和所有元素的框阴影效果