2016-04-28 7 views
0

AdvancedPhotoCaptureを使用してSoftwareBitmapを取得しようとしましたが、結果として得られるCapturedPhoto.Frame.SoftwareBitmapがnullです。 SoftwareBitmapをスクリーンに表示するには、どうすれば入手できますか?CapturedPhoto.Frame.SoftwareBitmap is null

//create mediacapture 
mediaCapture = new MediaCapture(); 
await mediaCapture.InitializeAsync(); 

// check if supported 
var settings = new AdvancedPhotoCaptureSettings 
{ 
    Mode = AdvancedPhotoMode.Standard 
}; 

//configure capture 
if (!mediaCapture.VideoDeviceController.AdvancedPhotoControl.SupportedModes.Contains(settings.Mode)) 
{ 
    Debug.WriteLine("Mode not supported"); 
    return; 
} 
mediaCapture.VideoDeviceController.AdvancedPhotoControl.Configure(settings); 
var adv = await mediaCapture.PrepareAdvancedPhotoCaptureAsync(ImageEncodingProperties.CreateJpeg()); 

// take photo 
var capturedPhoto = await adv.CaptureAsync(); 
Debug.WriteLine(capturedPhoto.Frame.SoftwareBitmap == null); 

答えて

1

非圧縮形式で符号化する場合等AdvancedPhotoCapture、VariablePhotoSequence、LowLagCaptureSequenceについて

ImageEncodingProperties.CreateUncompressed(MediaPixelFormat.Bgra8) 

ImageEncodingProperties.CreateJpeg() 

を交換SoftwareBitmapのみ移入されます。