3
votes

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

2
As for complicated Camera API, if you want to take a photo - this answer may help.Romasz
@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

2 Answers

1
votes

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

2
votes

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.