0

我正在 Windows Phone 8 中开发一个应用程序。基本上在我的应用程序中,我使用PhotoCaptureDeviceAPI 来拍摄快照和扫描条形码。当我继续使用硬件后退按钮继续返回相机页面时,有时相机页面会挂起并且无法继续进行。

The code snippet used is :

//Passing Videobrush to PhotoCapturedevice

VideoBrush brush;

brush.SetSource(_device);

//PhotoCapture Device Intialization

internal PhotoCaptureDevice _device;

CameraSensorLocation cameraLocation;

    if (PhotoCaptureDevice.AvailableSensorLocations.Contains(CameraSensorLocation.Back))
    {
          var supportedResolutions = PhotoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Back);
          _initRes = GetBestResolution(supportedResolutions);
           cameraLocation = CameraSensorLocation.Back;

     }
     else if (PhotoCaptureDevice.AvailableSensorLocations.Contains(CameraSensorLocation.Front))
     {
           var supportedResolutions = PhotoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Front);
           _initRes = GetBestResolution(supportedResolutions);
            cameraLocation = CameraSensorLocation.Front;

     }  

你能帮我解决这个问题吗

4

1 回答 1

0

您必须在调用 Brush.SetSource(_device); 之前初始化 photocapture 对象。

于 2013-08-27T11:28:00.713 回答