Image Control not displaying image at runtime

kgs1951

New member
Joined
May 18, 2025
Messages
1
Programming Experience
3-5
I am using visual studio 22 and vb.net. I am also using taglib library to extract the image from an audio file. See the following code:
Dim file As TagLib.File = TagLib.File.Create(MusicFile)
Dim bpm As Double = file.Tag.BeatsPerMinute


If file.Tag.Pictures.Length > 0 Then
Dim pict As TagLib.IPicture = file.Tag.Pictures(0)

Dim img As Byte()
img = pict.Data.Data
System.IO.File.WriteAllBytes("C:\Users\kgs19\Documents\My Cover Art\Img.png", img)


BitmapImage = New System.Windows.Media.Imaging.BitmapImage()


Dim uri As New Uri("C:\Users\kgs19\Documents\My Cover Art\Img.png", UriKind.Relative)
bitmapImage.BeginInit()
bitmapImage.UriSource = uri
bitmapImage.EndInit()
ImageCoverArt.Source = BitmapImage


The image displays in the folder "My Cover Art" but I can't get it to display on the image control(ImageCoverArt). WPF

Any Help would be very mutch asppreciated. Thanks





End If
 
Back
Top