Silverlight调用摄像头

Silverlight调用摄像头,第1张

概述 CaptureSource source = new CaptureSource();         private void UserControl_Loaded_1(object sender, RoutedEventArgs e)         {             VideoCaptureDevice vcd;             //话筒就换成这个类 AudioCaptu

 CaptureSource source = new CaptureSource();
        private voID UserControl_Loaded_1(object sender,RoutedEventArgs e)
        {
            VIDeoCaptureDevice vcd;
            //话筒就换成这个类 AudioCaptureDevice 
            vcd = CaptureDeviceConfiguration.GetDefaultVIDeoCaptureDevice();

            source.VIDeoCaptureDevice = vcd;

            VIDeoBrush vIDeo = new VIDeoBrush();
            vIDeo.SetSource(source);
            rectangle1.Fill = vIDeo;

            //截图的回调              source.CaptureImageCompleted += new EventHandler<CaptureImageCompletedEventArgs>(source_CaptureImageCompleted);         }                //截图调用 source.CaptureImageAsync();          voID source_CaptureImageCompleted(object sender,CaptureImageCompletedEventArgs e)         {             WriteableBitmap img = e.Result;         }                 //此处开始启动         private voID button_Click_1(object sender,RoutedEventArgs e)         {             if (CaptureDeviceConfiguration.AllowedDeviceAccess || CaptureDeviceConfiguration.RequestDeviceAccess())             {                 //启动摄像头 /麦克风以及其他 *** 作                  source.Start();             }         }

总结

以上是内存溢出为你收集整理的Silverlight调用摄像头全部内容,希望文章能够帮你解决Silverlight调用摄像头所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1016242.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存