久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

將位圖設置為 MP3 的封面

Set Bitmap as cover art for MP3(將位圖設置為 MP3 的封面)
本文介紹了將位圖設置為 MP3 的封面的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我一直在嘗試將位圖設置為 MP3 的封面,但我似乎無法讓它工作.它沒有拋出任何錯誤,但是當我播放 MP3 時,位圖沒有顯示.

I have been trying to set a bitmap as cover art for a MP3 but I can't seem to get it working. It isn't throwing any errors but when I play the MP3 the bitmap isn't showing.

這是我目前擁有的:

TagLib.File f = TagLib.File.Create("song.mp3");

Image currentImage = getAlbumArt(result.passedAlbumID);
Picture pic = new Picture();
pic.Type = PictureType.FrontCover;
pic.MimeType = System.Net.Mime.MediaTypeNames.Image.Jpeg;
pic.Description = "Cover";
MemoryStream ms = new MemoryStream();
currentImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
ms.Position = 0;
pic.Data = ByteVector.FromStream(ms);
f.Tag.Pictures = new IPicture[1] { pic };
pictureBox1.Image = currentImage; //testing the image is correct

f.Save();
ms.Close();

推薦答案

我正在使用以下代碼,一切正常:

I'm using the following code and everything works fine for me:

TagLib.File file = TagLib.File.Create(/*path to your mp3 file*/);
TagLib.Picture pic = new TagLib.Picture();
pic.Type = TagLib.PictureType.FrontCover;
pic.Description = "Cover";
pic.MimeType = System.Net.Mime.MediaTypeNames.Image.Jpeg;
MemoryStream ms = new MemoryStream();
/*your image*/.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
ms.Position = 0;
pic.Data = TagLib.ByteVector.FromStream(ms);
file.Tag.Pictures = new TagLib.IPicture[] { pic };
file.Save();
ms.Close();

根據您提供的代碼,我唯一注意到的是,我的代碼正在使用以下行

According to your provided code, the only thing I noticed is, that my code is using following line

file.Tag.Pictures = new TagLib.IPicture[] { pic };

代替

f.Tag.Pictures = new TagLib.IPicture[1] { pic };

所以簡單地嘗試一下,如果它在您刪除方括號內的 1 時有效.

So simply try, if it works when you remove the 1 inside the square brackets.

這篇關于將位圖設置為 MP3 的封面的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Right-click on a Listbox in a Silverlight 4 app(右鍵單擊 Silverlight 4 應用程序中的列表框)
WPF c# webbrowser scrolls over top menu(WPF c# webbrowser 在頂部菜單上滾動)
C# Console app - How do I make an interactive menu?(C# 控制臺應用程序 - 如何制作交互式菜單?)
How to avoid duplicate form creation in .NET Windows Forms?(如何避免在 .NET Windows Forms 中創建重復的表單?)
UI Automation Control Desktop Application and Click on Menu Strip(UI自動化控制桌面應用程序并單擊菜單條)
Removing thin border around the menuitems(刪除菜單項周圍的細邊框)
主站蜘蛛池模板: 国产精品欧美一区二区 | 免费看91| 国产日韩一区二区三免费高清 | 91精品国产91久久久久久吃药 | 久久草在线视频 | 一区二区三区在线免费观看 | 国产亚洲欧美另类一区二区三区 | www.四虎.com| 午夜精品一区二区三区在线观看 | 国产在线观看一区 | 乱码av午夜噜噜噜噜动漫 | 欧美一区二区免费电影 | 国产欧美一区二区三区久久 | 在线观看日本网站 | 久久精品亚洲欧美日韩精品中文字幕 | 精品香蕉一区二区三区 | 天天射天天干 | 国产一区二区三区久久久久久久久 | 国产高清一区二区三区 | 久久一二| 欧美久久电影 | 成人国产精品色哟哟 | 久久久久91| 亚洲视频一区二区三区 | a级性视频| 国产精品一区二区免费看 | 99热.com | 97国产爽爽爽久久久 | 在线观看视频一区 | 国产免费又色又爽又黄在线观看 | 午夜精品久久久久久久久久久久久 | 一区二区在线不卡 | 亚洲一区二区三区视频 | 日本一区高清 | 国产亚洲精品美女久久久久久久久久 | 免费国产视频在线观看 | 人人干人人干人人 | 国产一区在线免费观看视频 | 91精品国产91久久久久久 | 人人做人人澡人人爽欧美 | 久久亚洲国产精品 |