예제 #1
0
        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;
        }