VB.NET - 无法使视频预览工作
溢出。我有一个应用程序应该通过 DirectShowSource 转换视频。
我有一个复选框,它启用一个名为“btnviewcrop”的按钮,该按钮显示一个名为 crp.vb 的新表单,用于裁剪/剪切视频中的像素。
现在,我有一个 Panel1,我想将其设置为所有者(视频绘图表面),但是当我将其设置为打开时,应用程序崩溃(错误:对象引用未设置为对象的实例。)并且我不这样做了解如何修复它。
这是我的按钮代码:
Imports Microsoft.DirectX.AudioVideoPlayback
Private Sub btnviewcrop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnviewcrop.Click
Me.ShowInTaskbar = False
Me.Enabled = False
crp.Show()
Dim cropperv As Video
cropperv.Owner = crp.preview 'VS2010 reports that cropperv has been used before being assigned a value'
cropperv.FromFile(labinputfile.Text, True)
cropperv.Play()
End Sub
Overflow. I have an application which is supposed to convert a video via DirectShowSource.
I have a checkbox which enables a button called "btnviewcrop" which shows a new form called crp.vb for cropping/shearing pixels off the video.
Now, I have a Panel1 that I want to set as the owner (the video drawing surface) but when I set it to open, the application crashes (Error: Object reference not set to an instance of an object.) and I do not understand how to fix it.
Here is my button code:
Imports Microsoft.DirectX.AudioVideoPlayback
Private Sub btnviewcrop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnviewcrop.Click
Me.ShowInTaskbar = False
Me.Enabled = False
crp.Show()
Dim cropperv As Video
cropperv.Owner = crp.preview 'VS2010 reports that cropperv has been used before being assigned a value'
cropperv.FromFile(labinputfile.Text, True)
cropperv.Play()
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您从未将任何内容分配给
cropperv
。你的意思I don't think you ever assign anything to
cropperv
. Did you mean好点,如果我这样做:
那么除了需要完成调整大小之外,一切都很好。
我很感谢你的帮助,马蒂。
Good point, and if I do this:
Then all works out fine besides the resizing needs done.
I appreciate the help, Matti.