Using Camera in snapped state?

0

In my windows 8 application, after switching to "snapped state", whenever I invoke Camera capture event it shows following error:

A method was called at an unexpected time. (Exception from HRESULT: 0x8000000E).

Does it mean the camera does not work in snapped state, or I am missing something?

Note: the camera is working fine in every other state, i.e landscape, filled etc.

windows-8
microsoft-metro
asked on Stack Overflow Nov 17, 2012 by Zeshan Aman • edited Nov 17, 2012 by GSerg

1 Answer

1

CameraCaptureUI won't work in the snapped state, but that doesn't mean the camera doesn't work when the app is snapped.

Two options:

  1. Programmatically pull the app out of snapped mode prior to calling CameraCaptureUI methods - use TryUnsnap for this. The effect can be a bit jarring, and there is counsel in the documentation to NOT programmatically unsnap, so you'd want to make sure you do this 'right' (perhaps setting expectation in your snapped view that that will happen OR prompting the user to explicitly unsnap before using that functionality).
  2. Interface with the camera without using CameraCaptureUI. The Media Capture using capture device sample uses MediaCapture, for instance.
answered on Stack Overflow Nov 18, 2012 by Jim O'Neil

User contributions licensed under CC BY-SA 3.0