Csharp/C#教程:在Windows Store App的.mp3文件中获取Albumart分享


在Windows Store App的.mp3文件中获取Albumart

如何在mp3文件中获取AlbumArt图像? 我正在使用c#开发Windowsapp store应用。

MusicProperties类给了我相册名称艺术家姓名vs.但它不能给我albumart。

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

文件和文件夹缩略图样本

如果要保存专辑封面,请查看如何在Windows 8 metro应用程序中将缩略图保存到设备中c#

更新1

MediaFileStorageFileImageControl

 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; } } 

这是我对TagLib的问题的快速而简短的解决方案#:( https://taglib.github.io/ )

 using TagLib; var file = TagLib.File.Create(filename); var bin = (byte[])(file.Tag.Pictures[0].Data.Data); imageBox.Image = Image.FromStream(new MemoryStream(bin)); 

我在这里找到了一个解决方案如何:获取文件的IDE标签和缩略图

上述就是C#学习教程:在Windows Store App的.mp3文件中获取Albumart分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

 var bitmapImage = new BitmapImage(); //Get Album cover using (StorageItemThumbnail thumbnail = await file.GetThumbnailAsync(ThumbnailMode.MusicView, 300)) { if (thumbnail != null && thumbnail.Type == ThumbnailType.Image) { bitmapImage.SetSource(thumbnail); } else { //Error Message here } } 

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/cdevelopment/1010964.html

(0)
上一篇 2021年12月29日
下一篇 2021年12月29日

精彩推荐