I need some help with some code I found on freely distributed on the net. Unfortunatly I've lost the website to give credits so if anyone knows it please say and I'll give all credits. Anyway I'm new to VB and to programming in general in fact I'm not even 100% sure this is VB code. Either way the code was meant to be complete but when I go to run it I get an exception error. The code is as followed the piece in question that causes the execption is highlighted.
//Camera Start Stop
public void initialise_capture()
{
grabber = new Capture();
grabber.QueryFrame();
//Initialize the FrameGraber event
if (parrellelToolStripMenuItem.Checked)
{
Application.Idle += new EventHandler(FrameGrabber_Parrellel);
}
else
{
Application.Idle += new EventHandler(FrameGrabber_Standard);
}
}
private void stop_capture()
{
if (parrellelToolStripMenuItem.Checked)
{
Application.Idle -= new EventHandler(FrameGrabber_Parrellel);
}
else
{
Application.Idle -= new EventHandler(FrameGrabber_Standard);
}
if(grabber!= null)
{
grabber.Dispose();
}
}
I believe this is the part where the program attempts to capture the video device inorder for the feed to be shown on screen for the rest of the program to do it's thing. There maybe more errors in the rest of the code but this first one.
Thanks for your help
Cable
//Camera Start Stop
public void initialise_capture()
{
grabber = new Capture();
grabber.QueryFrame();
//Initialize the FrameGraber event
if (parrellelToolStripMenuItem.Checked)
{
Application.Idle += new EventHandler(FrameGrabber_Parrellel);
}
else
{
Application.Idle += new EventHandler(FrameGrabber_Standard);
}
}
private void stop_capture()
{
if (parrellelToolStripMenuItem.Checked)
{
Application.Idle -= new EventHandler(FrameGrabber_Parrellel);
}
else
{
Application.Idle -= new EventHandler(FrameGrabber_Standard);
}
if(grabber!= null)
{
grabber.Dispose();
}
}
I believe this is the part where the program attempts to capture the video device inorder for the feed to be shown on screen for the rest of the program to do it's thing. There maybe more errors in the rest of the code but this first one.
Thanks for your help
Cable