0

Unable to reach the PhotoCamera enter image description here

Tried all the examples from the internet , do not work. Help start the camera in any way , please.

Geri4
  • 167
  • 7
  • 1
    I believe you want the Microsoft.Devices namespace: https://msdn.microsoft.com/en-us/library/windows/apps/microsoft.devices.photocamera(v=vs.105).aspx – Josh Aug 01 '16 at 07:47
  • @Josh what are the alternatives? – Geri4 Aug 01 '16 at 07:52
  • 1
    Why can you not use Microsoft.Devices.PhotoCamera? – Josh Aug 01 '16 at 07:52
  • @Josh I can not find Microsoft.Devices.PhotoCamera. This can be seen in my screenshot. I am new to programming in windows phone, and do not know what I'm doing wrong ... – Geri4 Aug 01 '16 at 08:00
  • Your screenshot shows **Windows**.Devices, not **Microsoft**.Devices – Josh Aug 01 '16 at 08:02
  • @Josh In Microsoft no Devices. I have only to Microsoft CSharp and VisualBasic=( – Geri4 Aug 01 '16 at 08:11
  • 1
    Apologies, looks like you should be using Windows.Media.Capture, here is a comprehensive answer on a previous question: http://stackoverflow.com/questions/23605967/photo-capture-on-windows-store-app-for-windows-phone – Josh Aug 01 '16 at 08:20

2 Answers2

0

Use Microsoft.Devices.PhotoCamera() in Windows Phone Silverlight project. While use Windows.Media.Capture.CameraCaptureUI API to capture a photo in winrt project.

Rita Han
  • 9,574
  • 1
  • 11
  • 24
  • can not find no Microsoft.Devices.PhotoCamera (), not Windows.Media.Capture.CameraCaptureUI – Geri4 Aug 01 '16 at 10:01
  • @АлексейГерусенко You can use Windows.Storage.Pickers.FileOpenPicker and configure it to pick images. A comprehensive answer is [here](http://stackoverflow.com/questions/23605967/photo-capture-on-windows-store-app-for-windows-phone). – Rita Han Aug 02 '16 at 01:24
0

Under AppManifest.xml --> Capabilites --> Tick ID_CAP_ISV_CAMERA give this permission to your app.

CameraCaptureTask cameraCaptureTask = new CameraCaptureTask();
cameraCaptureTask.Completed += new EventHandler<PhotoResult>(cameraCaptureTask_Completed);
cameraCaptureTask.Show();

void cameraCaptureTask_Completed(object sender, PhotoResult e)
{
    try
    {
        if (e.TaskResult == TaskResult.OK)
        {
            // your code after get image capture
        }
    }
    catch (Exception ex)
    {
    }
}
Krunal Mevada
  • 1,637
  • 1
  • 17
  • 28