Zeshan Aman
Zeshan Aman

Reputation: 111

Using Camera in snapped state?

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.

Upvotes: 0

Views: 157

Answers (1)

Jim O'Neil
Jim O'Neil

Reputation: 23784

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.

Upvotes: 1

Related Questions