public Form1()
:base("GDI Video", 10, 10, 640, 480)
{
// Show a dialog box on the screen so the user
// can select which camera to use if they have
// multiple attached.
CaptureDeviceDescription capDescription = new CaptureDeviceDescription();
CameraSelection camForm = new CameraSelection();
camForm.ShowDialog();
//// Get the chosen configuration from the dialog
//// and use it to create a capture device.
object config = camForm.SetupPage.GetConfiguration();
m_CaptureDevice = (VideoCaptureDevice)capDescription.CreateVideoSource(config);
// Another way to get a hold of a capture device
//m_CaptureDevice = VideoCaptureDevice.CreateCaptureDeviceFromIndex(0, 320, 240);
m_CamControl = new CameraControl(m_CaptureDevice);
//Console.WriteLine("Capabilities: {0}", m_CaptureDevice.Capabilities.Count);
// Let the capture device know what function to call
// whenever a frame is received.
m_CaptureDevice.NewFrame += OnFrameReceived;
// Start the capture device on its own thread
m_CaptureDevice.Start();
fStick = new Joystick(winmm.JOYSTICKID1);
dispatcher = new TimedDispatcher(1.0 / 2, OnJoystickDispatch, null);
dispatcher.Start();
}