Exemple #1
0
        public async void StopSequenceCapture()
        {
            _recording = false;
            await _lowLagPhotoSequenceCapture.FinishAsync();

            ProgressBarHelper.HideProgressBar();
            ShowPreviewPage();
        }
Exemple #2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            ProgressBarHelper.ShowProgressBar("Processing sequence");

            // The image sources are provided as parameter
            List <IImageProvider> imageProviders = new List <IImageProvider>();

            if (e.Parameter is List <StorageFile> ) // Using list of files as source for sequence
            {
                var files = e.Parameter as List <StorageFile>;
                foreach (StorageFile storageFile in files)
                {
                    imageProviders.Add(new StorageFileImageSource(storageFile));
                }
            }
            else if (e.Parameter is int) // Using bundled resources as source for sequence, list of files is created here
            {
                int sequenceId           = (int)e.Parameter;
                int imageIndex           = 0;
                List <StorageFile> files = new List <StorageFile>();
                try
                {
                    while (true)
                    {
                        var         imageUri = new Uri("ms-appx:///Assets/sequence." + sequenceId + "." + imageIndex + ".jpg");
                        StorageFile file     = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(imageUri);

                        var stream = await file.OpenReadAsync(); // only for checking if file exists

                        stream.Dispose();
                        imageProviders.Add(new StorageFileImageSource(file));
                        imageIndex++;
                    }
                }
                catch (Exception)
                {
                    // Expected FileNotFoundException
                }
            }

            await PrepareImageSequence(imageProviders);

            Canvas.ManipulationMode     = ManipulationModes.TranslateX | ManipulationModes.TranslateY;
            Canvas.ManipulationStarted += ImageElement_ManipulationStarted;
            Canvas.ManipulationDelta   += ImageElement_ManipulationDelta;

            SetControlsEnabled(true);

            AdjustPreviewImageSizeAccordingToLayout();
            RootGrid.SizeChanged += AdjustPreviewImageSizeAccordingToOrientation;

            _animationTimer.Start();

            ProgressBarHelper.HideProgressBar();
        }
Exemple #3
0
        private async void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            Stop();
            await _renderTask;

            SetControlsEnabled(false);

            ProgressBarHelper.ShowProgressBar("Saving");

            await Save();

            ProgressBarHelper.HideProgressBar();

            if (Frame.BackStackDepth == 2)
            {
                Frame.BackStack.RemoveAt(1);
            }

            _navigationHelper.GoBack();
        }
 private void StartAnimation()
 {
     DeleteButton.IsEnabled = true;
     timer.Start();
     ProgressBarHelper.HideProgressBar();
 }
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     timer.Stop();
     ProgressBarHelper.HideProgressBar();
     base.OnNavigatedFrom(e);
 }
 public void StopCapture()
 {
     _stop = true;
     ProgressBarHelper.HideProgressBar();
     ShowPreview();
 }