How can i get the AlbumArt image in the mp3 file? I am developing Windows Store app with c#.
MusicProperties class gives me Album name artist name vs. But it cant give me albumart.
Check out MSDN sample to show thumbnail of any file. It also consists how to retrieve the album art.
File and folder thumbnail sample
If you want to save the album art check out How to store save Thumbnail image in device in windows 8 metro apps c#
UPDATE 1
MediaFile
is StorageFile
. ImageControl
is <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;
}
}
here's my quick and short solution for that problem thirding TagLib#: (http://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));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With