📜 ⬆️ ⬇️

Silverlight 4: Easy webcam review

Webcam support was the most anticipated innovation and did not become news to anyone. It is relatively easy to activate this feature. The following example demonstrates a simple UI with a code that connects a webcam. This post does not affect work with several webcams, however, calling CaptureDeviceConfiguration.GetAvailableVideoCaptureDevices , you get a list of all available webcams.

First, create a simple UI ( Rectangle and Button ).

image

Add a button click event. The logic looks like this:
image
')
The next step is to launch the application. You will see a blank screen with a button, after clicking on it, a request window will open to allow the program to use the webcam and microphone. Of course, click "Yes";).

image

Voila! .. Now you look at yourself, and maybe at the wall or ceiling.

image

After launching the application, I noticed a mirroring, so that the application would show the image as a mirror, set Flip rectangl by X excise. Here’s what this menu looks like in Blend:

image

Source: https://habr.com/ru/post/75912/


All Articles