I am having a little bit of problem with my coding.
Basically I have a form(mainForm) where I have a button to select a video device which directs me to a new form(deviceForm). Then I choose a device from a comboBox(deviceBox) and press the "Select" button. This would redirect me back to the mainForm and display the video on a picture box(pictureBox1).
Here is where I am having difficulties with. I can't seem to redirect from deviceForm to mainForm and have the video displayed.
What code should I put in the "Select" button on deviceForm?
This is what I put in the code.
<pre lang="sql">public void btnSelect_Click(object sender, EventArgs e)<br />
mainForm form1 = new mainForm();<br />
selectDevice = new
and in mainForm I have this for the picture box
private void pictureBox1(object sender, NewFrameEventArgs eventArgs)
deviceForm form2 = new deviceForm();
selectDevice = new VideoCaptureDevice(device[form2.deviceBox.SelectedIndex].MonikerString);
Bitmap img = (Bitmap)eventArgs.Frame.Clone();
this.Image = img;
I was able to display feed from the webcam on a single form but I can't do it on another form.
I also included
<pre lang="cs">using AForge.Video;<br />
using AForge.Video.DirectShow;</pre><br />
On the mainForm, the code line
has an error on deviceBox, it says inaccessible due to it's protection.
Oh yeah, if this help I am using the latest version of AForge.Net framework and visual studio 2010 ultimate, running on vista sp3 and usb webcam of modal CrystalEye. Doing it on C#(obviously lol)
Hope the veterans can help me in solving this simple problem.