gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 21:22:46 25 4
gpt4 key购买 nike

如何获取 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com