2016-08-09 10 views
3

を開き、私は前向きカメラを開こうとするが、その開口部のデフォルトバックこれを達成するためにどのように私を提案camera.Pleaseのですか?前面カメラ

CameraCaptureUI captureUI = new CameraCaptureUI(); 
captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg; 
StorageFile photo =await captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo); 

if (photo == null) 
{ 
    // User cancelled photo capture 
    return; 
} 

答えて

1

代わりCameraCaptureUIの、あなたはMediaCaptureクラスを使用しようとすることができます:https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn642092.aspx

あなたは、たとえば、デバイス情報クラスを使用して、使用可能なカメラを照会することができます

DeviceInformation device = (await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture)) 
     .FirstOrDefault(d => d.EnclosureLocation != null && d.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front); 

とあれば

MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings(); 
settings.VideoDeviceId = device.Id; 

MediaCapture mediaCapture = new MediaCapture(); 
await mediaCapture.InitializeAsync(settings); 
:デバイスが返され、それがMediaCaptureInitializationSettingsクラスのidだ設定
関連する問題