Taglib sharp album cover tutorial

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
User avatar
frozerlaxegon
Top Poster
Top Poster
Posts: 84
Joined: Thu May 13, 2010 4:38 pm

Hi, I wanted to get the embedded cover art of a music file I'm playing using taglib-sharp.
Here's my code, please help!
On form_load, I've already added SetAlbumArt() so that can't be the cause of the problem.
Code: Select all
 Private Sub SetAlbumArt()
        On Error Resume Next
        If Playlist.List.SelectedItem IsNot Nothing Then
            Dim file As TagLib.File = TagLib.File.Create(Playlist.List.SelectedItem.ToString())
            If file.Tag.Pictures.Length > 0 Then
                Dim bin = DirectCast(file.Tag.Pictures(0).Data.Data, Byte())

                pb.Image = Image.FromStream(New IO.MemoryStream(bin)).GetThumbnailImage(100, 100, Nothing, IntPtr.Zero)
            Else
                pb.Image = My.Resources.sry
            End If
        End If
    End Sub
Last edited by frozerlaxegon on Fri Aug 13, 2010 5:05 pm, edited 1 time in total.
You've been RICKROLL'D
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Have you tried Function instead of Private sub?
Top-notch casual Dating
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

What return variable/type should it be expecting?
User avatar
frozerlaxegon
Top Poster
Top Poster
Posts: 84
Joined: Thu May 13, 2010 4:38 pm

mandai wrote:
What return variable/type should it be expecting?
It returns nothing, it is suppose to be returning a picture of the album cover art.
You've been RICKROLL'D
4 posts Page 1 of 1
Return to “Tutorial Requests”