Connect to a Camera Device

If you have more than one camera devices, you can specify which device to use. The code snippet below demonstrates how to get the video and audio devices and initialize the camera with them.

To connect to a web cam manually, execute the following steps:

  1. Get the camera device. To do this, use the RadWebCam.GetVideoCaptureDevices static method.
  2. Get a video format from the camera. To do this, use the RadWebCam.GetVideoFormats static method.
  3. Initialize the camera device in the control. To do this, use the Initialize method of the RadWebCam control.
  4. Start the web cam control. To do this, use the Start method of the control.
ReadOnlyCollection<MediaFoundationDeviceInfo> videoDevices = RadWebCam.GetVideoCaptureDevices();
ReadOnlyCollection<MediaFoundationVideoFormatInfo> videoFormats = RadWebCam.GetVideoFormats(videoDevices[1], true);
ReadOnlyCollection<MediaFoundationDeviceInfo> audioDevices = RadWebCam.GetAudioCaptureDevices();
radWebCam1.Initialize(videoDevices[1], videoFormats[9], audioDevices[1]);
radWebCam1.Start();

See Also

In this article
Not finding the help you need? Improve this article