Ejemplo n.º 1
0
        void photoChooserTask_Completed(object sender, PhotoResult e)
        {
            if (e.TaskResult == TaskResult.OK)
            {
                this.progressBar.Visibility = System.Windows.Visibility.Visible;
                this.toggleButton.IsEnabled = true;

                byte[] imageBytes = new byte[e.ChosenPhoto.Length];
                e.ChosenPhoto.Read(imageBytes, 0, imageBytes.Count());

                string imageBase64 = Convert.ToBase64String(imageBytes);

                BitmapImage bmp = new BitmapImage();
                bmp.SetSource(e.ChosenPhoto);
                selectedImage.Source = bmp;

                UploadPhotosSoapClient proxy = new UploadPhotosSoapClient();
                proxy.UploadCompleted += proxy_UploadCompleted;

                proxy.UploadAsync(imageBase64, this.QrId);
            }
        }