GetVideoCamera() public method

Get Kinect's video camera.

The method simply creates instance of the KinectVideoCamera class by calling its appropriate constructor. Use KinectVideoCamera.Start method to start the video then.

public GetVideoCamera ( ) : KinectVideoCamera
return KinectVideoCamera
Example #1
0
        private void btnSelectCamera_Click(object sender, EventArgs e)
        {
            VideoCaptureDeviceForm form = new VideoCaptureDeviceForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                int deviceId = form.DeviceId;

                kinectDevice = Kinect.GetDevice(deviceId);

                if (videoCamera == null)
                {
                    videoCamera = kinectDevice.GetVideoCamera();
                    videoCamera.CameraMode = VideoCameraMode.Color;

                    controller.Device = videoCamera;
                    controller.Start();
                    controller.NewFrame += new NewFrameEventHandler(controller_NewFrame);
                }

                if (depthCamera == null)
                {
                    //depthCamera = kinectDevice.GetDepthCamera();
                    depthCamera = new KinectDepthCamera(deviceId, CameraResolution.Medium, true);

                    videoSourcePlayer1.VideoSource = depthCamera;
                    videoSourcePlayer1.Start();
                }


                toolStripStatusLabel1.Text = "Initializing...";
            }
        }