2010.11.7 su Peng
Content
-Connecting WebCam objects in Silverlight
-Use a WebCam object in Silverlight
-Save WebCam in Silverlight
Prerequisites
-Install Visual Studio 2010
-Install Expression Blend4
-Install Silverlight tools for Visual Studio 2010
-Understand C #
Start WebCam
-CaptureSource class
-CaptureDeviceConfiguration
-AllowedDeviceAccess
-RequestDeviceAccess
-VideoBrush object
Demo
-Use of WebCam
Enable OOB Application
DragMove indicates dragging and dropping the form, and Close indicates closing the form.
AllowedDeviceAccess indicates that video objects are allowed to be accessed. RequestDeviceAccess indicates that the camera is installed and occupied by other programs.
-CaptureImageAsync
-WriteableBitmap object
Demo
-Example of a WebCam object
Use WriteableBitmap to draw the parameters in the event.
Demo is from Yang Guo under the bodhi tree. Canvas is taken out as WriteableBitmap. Note that we can not only take out the video source Brush, but also use WriteableBitmap to take out the style of any Xaml object theoretically, save as an Image object.
Run the program and you will be prompted whether to use the camera device. This prompt is not provided in the example just now because the previous example is an OOB application, which has been installed on the desktop and checked with the confidence permission. Therefore, this question is not asked.
The original video uses the first method, which does not intercept text, but uses bitmap to intercept the Canvas, so the text will also be truncated.
Summary
-Connecting WebCam objects in Silverlight
-Use a WebCam object in Silverlight
-Save WebCam in Silverlight
2010.11.25