[英]How can I save this image as HD as possible?
我正在尝试修改歌曲的元数据。 我可以使用它,但是如果用户未指定专辑封面图像,我会自动从保存该专辑图像的图片框中绘制一个。 返回的图像真的很模糊-有什么办法可以使它尽可能的高清晰度吗? 这是我处理代码的部分:
if (isDir == false){
IPicture art2 = new TagLib.Picture(new TagLib.ByteVector((byte[])new System.Drawing.ImageConverter().ConvertTo(pictureBox1.Image, typeof(byte[])))); //I make the new picture here.
TagLib.File file2 = TagLib.File.Create(Properties.Settings.Default.NowPlayingPath);
file2.Tag.Title = SongBox.Text;
file2.Tag.AlbumArtists = artist;
file2.Tag.Genres = genre;
file2.Tag.Year = Convert.ToUInt32(YearBox.Text);
file2.Tag.Composers = composers;
file2.Tag.Pictures = new IPicture[1] { art2 };//I set the picture here.
file2.Save();
MessageBox.Show("You'll need to reload your song to continue listening to it.", "Settings saved.");
this.Hide();
}
}
尝试使用MemoryStream
获取图像作为字节数组:
MemoryStream ms = new MemoryStream();
pictureBox1.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] buff = ms.GetBuffer();
IPicture art2 = new TagLib.Picture(new TagLib.ByteVector(buff));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.