2013-05-16 78 views
0

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

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; 

    } 

你能帮我在这

回答

0

调用brush.SetSource(_device)之前,您必须初始化捕捉对象;

相关问题