VB.NET - cannot get Video Preview to work

Posted by Yiu Korochko on Stack Overflow See other posts from Stack Overflow or by Yiu Korochko
Published on 2010-05-30T20:25:50Z Indexed on 2010/05/30 20:32 UTC
Read the original article Hit count: 214

Filed under:
|
|
|
|

Hi, 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
     cropperv.FromFile(labinputfile.Text, True)
     cropperv.Play()
End Sub

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about video