如何在ListView中显示.wmv缩略图? [英] How to display .wmv thumbnails in a ListView?

查看:113
本文介绍了如何在ListView中显示.wmv缩略图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的应用创建播放列表编辑器,以在ListView中显示视频文件并显示添加文件的缩略图.我正在使用拖放功能将文件添加到ListView.我可以添加文件(显示文件名和详细信息),但是没有图像.这是我正在使用的代码:

I am trying to create a playlist editor for my app that displays video files in a ListView and show the thumbnails for the files added. I''m using Drag and Drop to add the files to the ListView. I can add the files (the file name and details are displayed ), but no image. Here''s the code that I am using:

Private Sub ListBox1_DragDrop(ByVal sender As Object, ByVal e As  _
    System.Windows.Forms.DragEventArgs) Handles ListBox1.DragDrop
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            Dim MyFiles() As String
            Dim i As Integer

            ' Assign the files to an array.
            MyFiles = e.Data.GetData(DataFormats.FileDrop)
            ' Loop through the array and add the files to the list.
            For i = 0 To MyFiles.Length - 1
                ListBox1.Items.Add(MyFiles(i))
            Next
        End If
    End Sub


    Private Sub ListView1_DragEnter(ByVal sender As Object, ByVal e As  _
System.Windows.Forms.DragEventArgs) Handles ListView1.DragEnter
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            e.Effect = DragDropEffects.All
        End If
    End Sub

    Private Sub ListView1_DragDrop(ByVal sender As Object, ByVal e As  _
    System.Windows.Forms.DragEventArgs) Handles ListView1.DragDrop
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            Dim MyFiles() As String
            Dim i As Integer

            ' Assign the files to an array.
            MyFiles = e.Data.GetData(DataFormats.FileDrop)
            ' Loop through the array and add the files to the list.
            For i = 0 To MyFiles.Length - 1
                ImageList1 = e.Data.GetData(DataFormats.Bitmap)
                ListView1.LargeImageList = ImageList1
                ListView1.Items.Add(MyFiles(i))
            Next
        End If
    End Sub



请帮忙!



Please help!

推荐答案

好,我看不到任何文件代码并获取或生成任何缩略图.

什么?您以为ListView会为您做到这一点?嗯不您必须自己编写一些代码.
OK, I don''t see any code that goes to the file and gets or generates any thumbnail image.

What? You thought the ListView was going to do this for you? Uhh, no. You have to write that bit of code yourself.


这篇关于如何在ListView中显示.wmv缩略图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆