【发布时间】:2015-07-22 11:43:32
【问题描述】:
我创建的项目基于: https://github.com/Microsoft/real-time-filter-demo/tree/master/RealtimeFilterDemoWP
我的问题是如何在 WP8.1 上启用闪光灯(手电筒) 我应该使用 MediaCapture() 吗?
var mediaDev = new MediaCapture();
await mediaDev.InitializeAsync();
var videoDev = mediaDev.VideoDeviceController;
var tc = videoDev.TorchControl;
if (tc.Supported)
{
if (tc.PowerSupported)
tc.PowerPercent = 100;
tc.Enabled = true;
}
当我使用它时它崩溃了
var videoDev = mediaDev.VideoDeviceController;
由于未处理的异常
- 如何在这个示例项目中添加手电筒?
【问题讨论】:
-
有什么异常?你在什么设备上运行这个?您应该查看 github.com/Microsoft/Windows-universal-samples 下的 CameraStarterKit 示例。尝试运行它,看看访问 VideoDeviceController 是否仍然给你一个异常。
标签: windows-phone-8.1 flashlight