예제 #1
0
        /// <summary>
        /// btnSitePhoto Click event.
        /// Allows the user to take a photo by using the TakePhoto.CallCamera function.
        /// Requires the entrySiteName field to be not null or a non-empty string.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        public async void btnSitePhoto_Clicked(object sender, EventArgs e)
        {
            // get site name
            if (entrySiteName.Text is null || entrySiteName.Text.Equals(""))
            {
                DependencyService.Get <ICrossPlatformToast>().ShortAlert("Name the Site before taking photo.");
                return;
            }

            await TakePhoto.CallCamera(trip.TripName + "-" + entrySiteName.Text);
        }
예제 #2
0
        async void btnFoto_Clicked(object sender, EventArgs e)
        {
            var usarCamara = ((Button)sender).Text.Contains("cámara");
            var file       = await TakePhoto.TomarFoto(usarCamara);

            panelResultados.Children.Clear();

            imgFoto.Source = ImageSource.FromStream(() =>
            {
                var stream = file.GetStream();
                streamCopy = new MemoryStream();
                stream.CopyTo(streamCopy);
                stream.Seek(0, SeekOrigin.Begin);
                file.Dispose();

                return(stream);
            });
        }
        void ReleaseDesignerOutlets()
        {
            if (AlbumSwitch != null)
            {
                AlbumSwitch.Dispose();
                AlbumSwitch = null;
            }

            if (MainImage != null)
            {
                MainImage.Dispose();
                MainImage = null;
            }

            if (PickPhoto != null)
            {
                PickPhoto.Dispose();
                PickPhoto = null;
            }

            if (PickVideo != null)
            {
                PickVideo.Dispose();
                PickVideo = null;
            }

            if (SizeSwitch != null)
            {
                SizeSwitch.Dispose();
                SizeSwitch = null;
            }

            if (TakePhoto != null)
            {
                TakePhoto.Dispose();
                TakePhoto = null;
            }

            if (TakeVideo != null)
            {
                TakeVideo.Dispose();
                TakeVideo = null;
            }
        }
예제 #4
0
        public App()
        {
            InitializeComponent();

            AboutPage      = new AboutPage();
            AddRecipe      = new AddRecipe();
            ItemDetailPage = new ItemDetailPage();
            NewItemPage    = new NewItemPage();
            Recipes        = new Recipes();
            TakePhoto      = new TakePhoto();
            EditRecipe     = new EditRecipe();

            NaviService = _container.Resolve <INavigationService>() as NavigationService;

            var pageFactory = _container.Resolve <IPageFactory>();
            var home        = pageFactory.GetPage(Pages.MainPage) as TabbedPage;

            StartupPage = home;
            MainPage    = StartupPage;
        }
예제 #5
0
 void ReleaseDesignerOutlets()
 {
     if (PickPhoto != null)
     {
         PickPhoto.Dispose();
         PickPhoto = null;
     }
     if (PickVideo != null)
     {
         PickVideo.Dispose();
         PickVideo = null;
     }
     if (TakePhoto != null)
     {
         TakePhoto.Dispose();
         TakePhoto = null;
     }
     if (TakeVideo != null)
     {
         TakeVideo.Dispose();
         TakeVideo = null;
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (AlbumSwitch != null)
            {
                AlbumSwitch.Dispose();
                AlbumSwitch = null;
            }

            if (CroppingSwitch != null)
            {
                CroppingSwitch.Dispose();
                CroppingSwitch = null;
            }

            if (FrontSwitch != null)
            {
                FrontSwitch.Dispose();
                FrontSwitch = null;
            }

            if (MainImage != null)
            {
                MainImage.Dispose();
                MainImage = null;
            }

            if (MainImage1 != null)
            {
                MainImage1.Dispose();
                MainImage1 = null;
            }

            if (MainImage2 != null)
            {
                MainImage2.Dispose();
                MainImage2 = null;
            }

            if (MainImage3 != null)
            {
                MainImage3.Dispose();
                MainImage3 = null;
            }

            if (MainImage4 != null)
            {
                MainImage4.Dispose();
                MainImage4 = null;
            }

            if (MainImage5 != null)
            {
                MainImage5.Dispose();
                MainImage5 = null;
            }

            if (OverlaySwitch != null)
            {
                OverlaySwitch.Dispose();
                OverlaySwitch = null;
            }

            if (PickPhoto != null)
            {
                PickPhoto.Dispose();
                PickPhoto = null;
            }

            if (PickVideo != null)
            {
                PickVideo.Dispose();
                PickVideo = null;
            }

            if (SizeSwitch != null)
            {
                SizeSwitch.Dispose();
                SizeSwitch = null;
            }

            if (SliderQuality != null)
            {
                SliderQuality.Dispose();
                SliderQuality = null;
            }

            if (TakePhoto != null)
            {
                TakePhoto.Dispose();
                TakePhoto = null;
            }

            if (TakeVideo != null)
            {
                TakeVideo.Dispose();
                TakeVideo = null;
            }
        }
예제 #7
0
 /// <summary>
 /// btnSetSpecimenPhoto Click event.
 /// Allows the User to take a photo that is saved with the filename site#-specimen#.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 public async void btnSetSpecimenPhoto_Clicked(object sender, EventArgs e)
 {
     await TakePhoto.CallCamera(site.RecordNo.ToString() + "-" + specimen.SpecimenNumber.ToString());
 }
        void ReleaseDesignerOutlets()
        {
            if (AlbumSwitch != null)
            {
                AlbumSwitch.Dispose();
                AlbumSwitch = null;
            }

            if (CroppingSwitch != null)
            {
                CroppingSwitch.Dispose();
                CroppingSwitch = null;
            }

            if (FrontSwitch != null)
            {
                FrontSwitch.Dispose();
                FrontSwitch = null;
            }

            if (MainImage != null)
            {
                MainImage.Dispose();
                MainImage = null;
            }

            if (OverlaySwitch != null)
            {
                OverlaySwitch.Dispose();
                OverlaySwitch = null;
            }

            if (PickPhoto != null)
            {
                PickPhoto.Dispose();
                PickPhoto = null;
            }

            if (PickVideo != null)
            {
                PickVideo.Dispose();
                PickVideo = null;
            }

            if (SizeSwitch != null)
            {
                SizeSwitch.Dispose();
                SizeSwitch = null;
            }

            if (SliderQuality != null)
            {
                SliderQuality.Dispose();
                SliderQuality = null;
            }

            if (SwitchCancel != null)
            {
                SwitchCancel.Dispose();
                SwitchCancel = null;
            }

            if (SwitchRotate != null)
            {
                SwitchRotate.Dispose();
                SwitchRotate = null;
            }

            if (TakePhoto != null)
            {
                TakePhoto.Dispose();
                TakePhoto = null;
            }

            if (TakeVideo != null)
            {
                TakeVideo.Dispose();
                TakeVideo = null;
            }
        }
예제 #9
0
 private void btnClickHandler()
 {
     StartCoroutine(TakePhoto.takeAndSave("test.png"));
 }