CameraCaptureTask of Windows Phone 8 App is not wo

2019-06-14 04:53发布

问题:

I have a Windows Phone 8 App, which is Live on Windows Store. Now, recently I got a complaint from one of my Client that they are not able to capture Photo, only selection of Photo works from Gallery. This issue is appearing when they updated their device to Windows 10. I am using following code

private void CapturePhoto()
    {
        CameraCaptureTask cameraCapture = new CameraCaptureTask();
        cameraCapture.Completed += (sender, args) =>
        {
            //checking if everything went fine when capturing a photo
            if (args.TaskResult != TaskResult.OK)
                return;
            args.ChosenPhoto.Position = 0;
            string evidenceName = Path.Combine(Constants.IMAGES_FOLDER_PATH, "evidence_" + MCSExtensions.GetDateTimestamp() + ".jpeg");
            saveAndDisplayEvidence(args.ChosenPhoto, evidenceName);
        };
        cameraCapture.Show();
    }

I am already developing Windows 10 App as an update but till I update the app. I need to solve this issue so they can use it for capturing images.

Can someone suggest, how to solve this issue?

回答1:

The UI on Windows 10 is "less than intuitive", and to take a picture using the CameraCaptureTask, the end user needs to use the ... in the app bar, and Choose location to select camera. For your scenario, you may wantt o upgrade to a Windows 10 UWP app and use CameraCaptureUI



回答2:

I had the same issue with my application as well. You have to create your own camera capturing application You can go through the following links

  1. Advanced Camera Application
  2. Basic Camera Application.