现在的位置: 首页 > 综合 > 正文

silverlight: how to programming with video device

2012年05月25日 ⁄ 综合 ⁄ 共 443字 ⁄ 字号 评论关闭

Using the following code to interact with local video device:

 

1    if (CaptureDeviceConfiguration.RequestDeviceAccess())
2 {
3 CaptureSource captureSource = new CaptureSource() { VideoCaptureDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice() };
4 VideoBrush videoBrush = new VideoBrush();
5 videoBrush.SetSource(captureSource);
6 Rectangle rectangle = new Rectangle() { Height = 500, Width = 500, Fill = videoBrush };
7 LayoutRoot.Children.Add(rectangle);
8 captureSource.Start();
9 }

 

抱歉!评论已关闭.