IReadOnlyList<object> supportedFlashModes = PhotoCaptureDevice.GetSupportedPropertyValues(CameraSensorLocation.Front, KnownCameraPhotoProperties.FlashMode);
_availableStates = new FlashStates();
foreach (uint supportedFlashMode in supportedFlashModes)
{
_availableStates.Add(
new FlashState() { State = (FlashMode)supportedFlashMode }
);
}
结果是:0,1,3
但FlashMode枚举值为:1,2,3和4 ..没有0值!所以当我尝试使用此代码
检查关闭模式(值= 0)时_availableStates.Exists(fs => fs.State == mode);
它返回FALSE,应该返回TRUE而不是......
怎么可能?
答案 0 :(得分:1)
FlashMode属性的类型为FlashState,其Enum值为0,1和3。
FlashState枚举:http://msdn.microsoft.com/en-us/library/windowsphone/develop/windows.phone.media.capture.flashstate(v=vs.105).aspx
我希望有所帮助。