[英]Setting AutoFlash in Windows Phone 8.1/WinRT
我當前在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
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.