Example #1
0
        public AddPage()
        {
            InitializeComponent();

            photoChooser = new PhotoChooserTask();
            photoChooser.Completed += photoChooser_Completed;
        }
 private void ShutterButton_Click(object sender, RoutedEventArgs e)
 {
     //string fileName = @"C:\Data\Users\Public\Pictures\Camera Roll\MyBarcode.jpg";
     //if (!File.Exists(fileName))
     //    return;
     PhotoChooserTask pct = new Microsoft.Phone.Tasks.PhotoChooserTask();
     pct.Show();
     pct.Completed += pct_Completed;
     return;
     if (cam != null)
     {
         try
         {
             // Start image capture.
             cam.CaptureImage();
             int currSec = DateTime.Now.Second + 5;
             while (true)
             {
                 if (DateTime.Now.Second >= currSec)
                 {
                     ReadBarcode();
                     NavigationService.GoBack();
                     break;
                 }
             }
         }
         catch (Exception ex)
         {
             this.Dispatcher.BeginInvoke(delegate()
             {
                 // Cannot capture an image until the previous capture has completed.
                 txtDebug.Text = ex.Message;
             });
         }
     }
 }
 private void ImageButton_Click(object sender, RoutedEventArgs e)
 {
     PhotoChooserTask pct = new Microsoft.Phone.Tasks.PhotoChooserTask();
     pct.Show();
     pct.Completed += pct_Completed;
 }