Photo capture on Windows Store App for Windows Phone

后端 未结 3 396
遇见更好的自我
遇见更好的自我 2020-11-29 01:04

Well, my question is simple:
How do I capture pictures with a Windows Store App for Windows Phone 8.1, using the camera?
The samples on MSD

3条回答
  •  借酒劲吻你
    2020-11-29 01:20

    In universal Windows Phone 8.1 (WinRT) apps it is no longer possible to jump directly into the built-in camera app and receive a callback when a picture was taken.

    To do that you have to implement Windows.Media.Capture.MediaCapture as described above. There used to be CameraCatureUI but it is not available in WinRT apps for Windows Phone 8.1.

    However there is a "workaround". You can use Windows.Storage.Pickers.FileOpenPicker and configure it to pick images. Now the picker will have a camera-button. The user can click the camera-button and the built-in camera app will open. Once the user has taken a picture you will receive a callback in your app. The FileOpenPicker callback is a little annoying to implement, but it works. If you can live with the usability implications this might be a valid approach.

    There was a session on this topic during Microsofts build-Conference in 2014. You can watch the session online with this link.

提交回复
热议问题