private void OrientationChanged(CameraRotationHelper cameraRotationHelper) { var previewOrientation = cameraRotationHelper.GetCameraPreviewOrientation(); var videoRotation = CameraRotationHelper.ConvertSimpleOrientationToVideoRotation(previewOrientation); Capture.SetPreviewRotation(videoRotation); }
private async Task WatchForOrientationChange(MediaCapture capture) { var camera = await DeviceInformation.CreateFromIdAsync(capture.MediaCaptureSettings.VideoDeviceId); var cameraRotationHelper = new CameraRotationHelper(camera.EnclosureLocation); OrientationChanged(cameraRotationHelper); cameraRotationHelper.OrientationChanged += CameraRotationHelper_OrientationChanged; }