1
Guys I was using the code below to create video thumbnail and show in a Listview:
Dim cont As Integer = 0
Dim thumbnail As New ImageList With {.ImageSize = New Size(200, 200)}
Dim caminho_saida As String = "C:\..."
Dim caminho_thumb As String
Dim name_arquivos As String
Dim xx As Image
For Each zz In FileIO.FileSystem.GetFiles(caminho_saida)
My.Computer.FileSystem.DeleteFile(zz)
Next
FolderBrowserDialog1.ShowDialog()
Try
For Each caminho_videos In FileIO.FileSystem.GetFiles(FolderBrowserDialog1.SelectedPath, FileIO.SearchOption.SearchAllSubDirectories, "*.mp4")
name_arquivos = System.IO.Path.GetFileNameWithoutExtension(caminho_videos)
caminho_thumb = caminho_saida + name_arquivos + ".png"
Try
Dim ffMpeg = New NReco.VideoConverter.FFMpegConverter()
ffMpeg.GetVideoThumbnail(caminho_videos, caminho_thumb, 20)
Catch ex As Exception
MsgBox(caminho_videos)
End Try
Using str As Stream = File.OpenRead(caminho_thumb)
xx = Image.FromStream(str)
thumbnail.Images.Add(xx)
End Using
ListView1.LargeImageList = thumbnail
ListView1.Items.Add(name_arquivos, cont)
cont += 1
Next
Finally
End Try
The problem is that the result in Listview is a "bad" image, and the original has the quality of the original file. What I’d like to know is how I concert this.
Won’t be the method
GetVideoThumbnail
that is bringing a poor quality image? Or if you open the image manually it has good quality but only when you put in theListView
is that it becomes weak?– João Martins
Exactly! Only when I put it in the listview it loses quality. Ex: In the image above on the left is the listview and looks like the last image of Paramount is bad, already on the right is the original version of the image that is played in the listview (the image that comes out of Getvideothumbnail).
– Lucas Pedro
In Picturebox the image is normal, but not in Listview.
– Lucas Pedro