public PhotoCamera cam = new PhotoCamera(CameraType.Primary);
private void flash_on(bject sender, RoutedEventArgs e)
{
cam.FlashMode = FlashMode.on;
}
Пытаюсь включить вспышку (как фонарик), но выдает ошибку на строке cam.FlashMode = FlashMode.on;
System.UnauthorizedAccessException не обработано пользовательским кодом
HResult=-2147024891
Message=Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Source=Windows
StackTrace:
at Windows.Phone.Media.Capture.PhotoCaptureDevice.GetSupportedPropertyValues(CameraSensorLocation sensor, Guid propertyId)
at Microsoft.Devices.PhotoCamera.IsFlashModeSupported(FlashMode mode)
at Microsoft.Devices.PhotoCamera.set_FlashMode(FlashMode value)
at PhoneApp1.MainPage.falshlight_power(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
InnerException: