How to get mp3 tag image in picture box in vb.net
How to get mp3 tag image in picture box using vb.net
(ScreenShot)
*********************************************
'code from here
Imports HundredMilesSoftware.UltraID3Lib
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.ShowDialog()
AxWindowsMediaPlayer1.URL = (OpenFileDialog1.FileName)
For Each track In OpenFileDialog1.FileNames
ListBox2.Items.Add(System.IO.Path.GetFileName(track))
Next
For Each track In OpenFileDialog1.FileNames
ListBox1.Items.Add(track)
Next
ListBox2.SelectedIndex = 0
ListBox1.SelectedIndex = 0
TextBox1.Text = System.IO.Path.GetFileName(ListBox1.SelectedIndex)
Dim MP3Tag As New UltraID3
MP3Tag.Read(AxWindowsMediaPlayer1.currentMedia.sourceURL)
Try
Dim pics = MP3Tag.ID3v23Tag.Frames.GetFrames(MultipleInstanceFrameTypes.Picture)
PictureBox1.BackgroundImage = CType(pics(0), ID3PictureFrame).Picture
Catch ex As Exception
PictureBox1.BackgroundImage = Nothing
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
(ScreenShot)
*********************************************
'code from here
Imports HundredMilesSoftware.UltraID3Lib
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.ShowDialog()
AxWindowsMediaPlayer1.URL = (OpenFileDialog1.FileName)
For Each track In OpenFileDialog1.FileNames
ListBox2.Items.Add(System.IO.Path.GetFileName(track))
Next
For Each track In OpenFileDialog1.FileNames
ListBox1.Items.Add(track)
Next
ListBox2.SelectedIndex = 0
ListBox1.SelectedIndex = 0
TextBox1.Text = System.IO.Path.GetFileName(ListBox1.SelectedIndex)
Dim MP3Tag As New UltraID3
MP3Tag.Read(AxWindowsMediaPlayer1.currentMedia.sourceURL)
Try
Dim pics = MP3Tag.ID3v23Tag.Frames.GetFrames(MultipleInstanceFrameTypes.Picture)
PictureBox1.BackgroundImage = CType(pics(0), ID3PictureFrame).Picture
Catch ex As Exception
PictureBox1.BackgroundImage = Nothing
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
******************** End Project **********************
Comments
Post a Comment