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调用摄像头所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)