Click here to Skip to main content
15,901,373 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to add any number of album art into listbox?.this is my code
<pre lang="c#"> 
        BitmapFrame bmp = null;
        public int Getpic(string s)
        {
           
            img.Source = null;
           string a = s;
            MemoryStream stream = null;
            TagLib.File file = TagLib.File.Create(a); //FilePath is the audio file location
            
            if (file.Tag.Pictures.Length >= 1)
            {
                TagLib.IPicture pic = file.Tag.Pictures[0];  //pic contains data for image.
                stream = new MemoryStream(pic.Data.Data);//create an in memory stream
                
                bmp = BitmapFrame.Create(stream);
                img.Source = bmp;
              
               
            }
Posted
Comments
Sergey Alexandrovich Kryukov 25-Apr-12 0:12am    
Next time, please do not re-post (I've removed your next post on this topic). Instead, use "Improve question", if you need.
--SA

1 solution

You can use nearly any content to the items of any System.Windows.Controls.ItemControl, including System.Windows.Controls.ListBox, which has the property Items.

Please see:
http://msdn.microsoft.com/en-us/library/system.windows.controls.listbox.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.items.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900