예제 #1
0
        private async void TakePictureButton_Clicked(object sender, EventArgs e)
        {
            await CrossMedia.Current.Initialize();

            if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
            {
                await DisplayAlert("No Camera", "No camera available.", "OK");

                return;
            }

            file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
            {
                SaveToAlbum = true,
                Name        = "test.jpg"
            });

            if (file == null)
            {
                return;
            }

            ShowActivityIndicator(true);

            // Upload image to azure blob storage
            azureImage = await AzureStorage.UploadImage(file);

            Image1.Source       = ImageSource.FromStream(() => file.GetStream());
            this.BindingContext = await DetectFaceAndEmotionsAsync(azureImage.StorageUri);

            AddFaceButton.IsEnabled = true;
            ShowActivityIndicator(false);
        }
예제 #2
0
        private async void TakePictureButton_Clicked(object sender, EventArgs e)
        {
            await CrossMedia.Current.Initialize();

            if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
            {
                await DisplayAlert("No Camera", "No camera available.", "OK");

                return;
            }

            file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
            {
                SaveToAlbum = true,
                Name        = "test.jpg"
            });

            if (file == null)
            {
                return;
            }

            // Upload image to azure blob storage
            azureImage = await AzureStorage.UploadImage(file);
        }
예제 #3
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            ShowActivityIndicator(true);
            lstImages.ItemsSource = await AzureStorage.GetBlobImages();

            ShowActivityIndicator(false);
        }