3

I'm developing a WP81 app, and I have some troble in capturing image from camera. I want to capture camera or select photo in piture hub with simple method like WP71's CameraTask or PhotoChooser. But I cannot find any other similar method in WP81's sdk. Does anyone know the similar apis?

WP71's CameraTask, PhotoChooser api: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006(v=vs.105).aspx

WP81's raw and complicated camera api: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn642091.aspx

Hyundong Hwang
  • 711
  • 1
  • 8
  • 19
  • As for complicated Camera API, if you want to take a photo - [this answer may help](http://stackoverflow.com/a/23606620/2681948). – Romasz May 16 '14 at 04:57
  • 1
    @Romasz Thank you :). But I am looking for more simple apies like WP71's simple CameraTask. I do not want to create the custom shutter button separetely for every simple use. – Hyundong Hwang May 19 '14 at 05:59

2 Answers2

2

You can use

FileOpenPicker picker = new FileOpenPicker();
Helpers.FillDecoderExtensions(picker.FileTypeFilter);
picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;

Which opens the File Open picker, set to images, which gives the option of capturing a fresh image.

See http://channel9.msdn.com/Events/Build/2014/2-525 for more info.

Jon B
  • 875
  • 7
  • 18
1

Your link to WP71's Api works on Windows Phone (7 & 8).

For Windows Phone 8.1, I've find this : http://msdn.microsoft.com/en-us/library/windows/apps/dn376408.aspx but the CameraCaptureUI control is not available on Windows Phone 8.1 devices. Use the lower-level Windows.Media.Capture API instead: see Quickstart: capturing video by using the MediaCapture api for more information.

Momentarily, you can use IoC pattern (if you have different projects, an interface on your common project, and 2 classes on your specific platforms projects, that inherit from the interface - and you call your methods on common project) or if directives

Andres Talavera
  • 2,100
  • 2
  • 17
  • 29
  • 4
    What on earth in wrong with MS. Now I have to have 3 different ways for Camera?? One for WP8.0, WP8.1 and Win8.1... so stupid. – zezba9000 Jan 08 '15 at 02:52