/// <summary>
        /// This event will be raised only on devices that support returning a reference photo, which is a normal exposure of the scene
        /// without HDR, also referred to as "EV0".
        /// </summary>
        /// <param name="sender">The object raising this event.</param>
        /// <param name="args">The event data.</param>
        private async void AdvancedCapture_OptionalReferencePhotoCaptured(AdvancedPhotoCapture sender, OptionalReferencePhotoCapturedEventArgs args)
        {
            // Retrieve the context (i.e. what capture does this belong to?)
            var context = args.Context as AdvancedCaptureContext;

            Debug.WriteLine("AdvancedCapture_OptionalReferencePhotoCaptured for {0}", context.CaptureFileName);

            // Remove "_HDR" from the name of the capture to create the name of the reference
            var referenceName = context.CaptureFileName.Replace("_HDR", "");

            using (var frame = args.Frame)
            {
                await ReencodeAndSavePhotoAsync(frame, referenceName, context.CaptureOrientation);
            }
        }
예제 #2
0
        /// <summary>
        /// This event will be raised only on devices that support returning a reference photo, which is a normal exposure of the scene
        /// without processing, also referred to as "EV0".
        /// </summary>
        /// <param name="sender">The object raising this event.</param>
        /// <param name="args">The event data.</param>
        private async void AdvancedCapture_OptionalReferencePhotoCaptured(AdvancedPhotoCapture sender, OptionalReferencePhotoCapturedEventArgs args)
        {
            // Retrieve the context (i.e. the information about the capture this event belongs to)
            var context = args.Context as AdvancedCaptureContext;

            // Add "_Reference" at the end of the filename to create when saving the reference photo
            var referenceName = context.CaptureFileName.Replace(".jpg", "_Reference.jpg");

            // Hold a reference to the frame before the async file creation operation so it's not cleaned up before ReencodeAndSavePhotoAsync
            using (var frame = args.Frame)
            {
                var file = await _captureFolder.CreateFileAsync(referenceName, CreationCollisionOption.GenerateUniqueName);

                Debug.WriteLine("AdvancedCapture_OptionalReferencePhotoCaptured for " + context.CaptureFileName + ". Saving to " + file.Path);

                await ReencodeAndSavePhotoAsync(frame, file, context.CaptureOrientation);
            }
        }
        /// <summary>
        /// This event will be raised only on devices that support returning a reference photo, which is a normal exposure of the scene
        /// without HDR, also referred to as "EV0".
        /// </summary>
        /// <param name="sender">The object raising this event.</param>
        /// <param name="args">The event data.</param>
        private async void AdvancedCapture_OptionalReferencePhotoCaptured(AdvancedPhotoCapture sender, OptionalReferencePhotoCapturedEventArgs args)
        {
            // Retrieve the context (i.e. what capture does this belong to?)
            var context = args.Context as AdvancedCaptureContext;

            // Remove "_HDR" from the name of the capture to create the name of the reference photo (this is the non-HDR capture)
            var referenceName = context.CaptureFileName.Replace("_HDR", "");

            var file = await _captureFolder.CreateFileAsync(referenceName, CreationCollisionOption.GenerateUniqueName);
            Debug.WriteLine("AdvancedCapture_OptionalReferencePhotoCaptured for " + context.CaptureFileName + ". Saving to " + file.Path);

            using (var frame = args.Frame)
            {
                await ReencodeAndSavePhotoAsync(frame, file, context.CaptureOrientation);
            }
        }
        /// <summary>
        /// This event will be raised only on devices that support returning a reference photo, which is a normal exposure of the scene
        /// without processing, also referred to as "EV0".
        /// </summary>
        /// <param name="sender">The object raising this event.</param>
        /// <param name="args">The event data.</param>
        private async void AdvancedCapture_OptionalReferencePhotoCaptured(AdvancedPhotoCapture sender, OptionalReferencePhotoCapturedEventArgs args)
        {
            // Retrieve the context (i.e. the information about the capture this event belongs to)
            var context = args.Context as AdvancedCaptureContext;
            
            // Add "_Reference" at the end of the filename to create when saving the reference photo
            var referenceName = context.CaptureFileName.Replace(".jpg", "_Reference.jpg");

            // Hold a reference to the frame before the async file creation operation so it's not cleaned up before ReencodeAndSavePhotoAsync
            using (var frame = args.Frame)
            {
                var file = await _captureFolder.CreateFileAsync(referenceName, CreationCollisionOption.GenerateUniqueName);
                Debug.WriteLine("AdvancedCapture_OptionalReferencePhotoCaptured for " + context.CaptureFileName + ". Saving to " + file.Path);

                await ReencodeAndSavePhotoAsync(frame, file, context.CaptureOrientation);
            }
        }
        /// <summary>
        /// This event will be raised only on devices that support returning a reference photo, which is a normal exposure of the scene
        /// without HDR, also referred to as "EV0".
        /// </summary>
        /// <param name="sender">The object raising this event.</param>
        /// <param name="args">The event data.</param>
        private async void AdvancedCapture_OptionalReferencePhotoCaptured(AdvancedPhotoCapture sender, OptionalReferencePhotoCapturedEventArgs args)
        {
            // Retrieve the context (i.e. what capture does this belong to?)
            var context = args.Context as AdvancedCaptureContext;

            Debug.WriteLine("AdvancedCapture_OptionalReferencePhotoCaptured for {0}", context.CaptureFileName);

            // Remove "_HDR" from the name of the capture to create the name of the reference
            var referenceName = context.CaptureFileName.Replace("_HDR", "");

            using (var frame = args.Frame)
            {
                await ReencodeAndSavePhotoAsync(frame, referenceName, context.CaptureOrientation);
            }
        }
예제 #6
0
        /// <summary>
        /// This event will be raised only on devices that support returning a reference photo, which is a normal exposure of the scene
        /// without HDR, also referred to as "EV0".
        /// </summary>
        /// <param name="sender">The object raising this event.</param>
        /// <param name="args">The event data.</param>
        private async void AdvancedCapture_OptionalReferencePhotoCaptured(AdvancedPhotoCapture sender, OptionalReferencePhotoCapturedEventArgs args)
        {
            // Retrieve the context (i.e. what capture does this belong to?)
            var context = args.Context as AdvancedCaptureContext;

            // Remove "_HDR" from the name of the capture to create the name of the reference photo (this is the non-HDR capture)
            var referenceName = context.CaptureFileName.Replace("_HDR", "");

            var file = await _captureFolder.CreateFileAsync(referenceName, CreationCollisionOption.GenerateUniqueName);

            Debug.WriteLine("AdvancedCapture_OptionalReferencePhotoCaptured for " + context.CaptureFileName + ". Saving to " + file.Path);

            using (var frame = args.Frame)
            {
                await ReencodeAndSavePhotoAsync(frame, file, context.CaptureOrientation);
            }
        }