c# – 在Windows Phone 8.1 / WinRT中设置AutoFlash
发布时间:2020-12-15 22:14:09 所属栏目:百科 来源:网络整理
导读:我目前在 Windows Phone 8.1应用程序中使用MediaCapture.我让相机按要求工作,但改变闪光状态证明是困难的. 与默认的相机应用程序一样,我希望有三种状态 – 自动,关闭和开启.我正在使用的代码如下: switch (mode) { case FlashMode.Auto: _captureManager.Vi
我目前在
Windows Phone 8.1应用程序中使用MediaCapture.我让相机按要求工作,但改变闪光状态证明是困难的.
与默认的相机应用程序一样,我希望有三种状态 – 自动,关闭和开启.我正在使用的代码如下: switch (mode) { case FlashMode.Auto: _captureManager.VideoDeviceController.FlashControl.Auto = true; _captureManager.VideoDeviceController.FlashControl.Enabled = false; if (_captureManager.VideoDeviceController.FlashControl.AssistantLightSupported) _captureManager.VideoDeviceController.FlashControl.AssistantLightEnabled = true; break; case FlashMode.On: _captureManager.VideoDeviceController.FlashControl.Auto = false; _captureManager.VideoDeviceController.FlashControl.Enabled = true; if (_captureManager.VideoDeviceController.FlashControl.AssistantLightSupported) _captureManager.VideoDeviceController.FlashControl.AssistantLightEnabled = true; break; case FlashMode.Off: _captureManager.VideoDeviceController.FlashControl.Auto = false; _captureManager.VideoDeviceController.FlashControl.Enabled = false; if (_captureManager.VideoDeviceController.FlashControl.AssistantLightSupported) _captureManager.VideoDeviceController.FlashControl.AssistantLightEnabled = false; break; } “开”和“关”模式工作正常,相机启动时设置为“自动”.但是,一旦您将相机更改为开启,然后关闭然后再返回自动,则闪光灯永远不会再次打开(我已经确认它不是场景的照明).我有什么想法可以重新启用自动闪光? 解决方法
Enabled优先于Auto,因为它在整个FlashControl上运行.
如果需要自动闪存,则需要将Enabled和Auto设置为true. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |