下面是我用来播放视频的代码。视频在面板上播放,但是当开始播放视频时,它只显示视频的一部分,如何将视频放在面板内?另外我怎样才能获得视频的默认大小(高度和宽度),以便我可以保持纵横比。
Private Sub movieWindow_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles movieWindow.DragDrop
Dim file_names As String() = DirectCast(e.Data.GetData(DataFormats.FileDrop), String())
Dim result As String
For Each file_name As String In file_names
result = file_name.Substring(file_name.LastIndexOf("\") + 1)
frmPlayList.playlist.Items.Add(result)
frmPlayList.playlist2.Items.Add(file_name)
Next file_name
frmPlayList.playlist2.SelectedIndex = frmPlayList.playlist2.Items.Count - 1
filename = frmPlayList.playlist2.SelectedIndex
retVal = mciSendString("play movie", 0, 0, 0)
End Sub