-
July 24th, 2013, 04:56 PM
#1
Help with some code
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 programming in general in fact I'm not even 100% sure this is C# 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
-
July 25th, 2013, 10:55 AM
#2
Re: Help with some code
You'll need to figure out where the code was from. If it's from a framegrabber card, you'll need to have the device installed on your computer. Usually mfg that make such cards have SDKs (Software Development Kits) that include code samples to help you.
-
July 25th, 2013, 10:59 AM
#3
Re: Help with some code
Originally Posted by Arjay
You'll need to figure out where the code was from. If it's from a framegrabber card, you'll need to have the device installed on your computer. Usually mfg that make such cards have SDKs (Software Development Kits) that include code samples to help you.
Thanks for the reply. This is only a segment of the code i do have the whole thing. Its meant to capture any video input device you currently have pluged into your pc and then perform face recognition on it. However when i try to run the code in vb suits 2012 it comes up with the debug error that i hightlighted and im stumped
Cable
-
July 25th, 2013, 04:14 PM
#4
Re: Help with some code
What is the error? Is it a compile or runtime error? Also, it's C# code, and you mention vb - you realize that C# code isn't going to run under vb, right?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|