Tag: 封面

使用taglib在WPF的“图像”框中显示封面图样

我正在制作一名玩家而且我陷入了一个看似简单的问题。 我需要将歌曲的封面艺术显示在一个图像框中。 我找到了这两个解决方案: 这个: var file = TagLib.File.Create(filename); if (file.Tag.Pictures.Length >= 1) { var bin = (byte[])(file.Tag.Pictures[0].Data.Data); PreviewPictureBox.Image = Image.FromStream(new MemoryStream(bin)).GetThumbnailImage(100, 100, null, IntPtr.Zero); } 还有这个: System.Drawing.Image currentImage = null; // In method onclick of the listbox showing all mp3’s TagLib.File f = new TagLib.Mpeg.AudioFile(file); if (f.Tag.Pictures.Length > 0) { TagLib.IPicture pic = f.Tag.Pictures[0]; MemoryStream […]