Exemplo n.º 1
0
 private void BTN_Back_Click(object sender, EventArgs e)
 {
     Setup.LogStat(StatTypes.BackToSimpleMode);
     this.Hide();
     CameraForm.Instance.LastSetupForm = CameraForm.Instance.SimpleSetupForm;
     CameraForm.Instance.SimpleSetupForm.Show();
 }
Exemplo n.º 2
0
        private void SimpleSetup_Load(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    cameraFilters = new FilterCollection(FilterCategory.VideoInputDevice);
                }
                catch (Exception exc)
                {
                    Setup.Log("Could not retrieve camera devices", exc);
                }

                if (cameraFilters == null || cameraFilters.Count == 0)
                {
                    Setup.LogStat(StatTypes.Error, "No cameras found (SimpleMode)");
                    MessageBox.Show(this, "Sorry!  We could not detect a web camera.  Are you sure it's plugged in?\n\nDouble check your web camera settings and try \"Easy Photo Booth\" again.", "No web camera detected", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    Application.Exit();
                }
            }
            catch (Exception ex)
            {
                Setup.Log("Cannot load simple setup form", ex);
                MessageBox.Show(this, "Could not start application!  Please send us your Log.txt file for troubleshooting", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 3
0
        private void pictureBoxDisplay_Click(object sender, EventArgs e)
        {
            MouseEventArgs me = (MouseEventArgs)e;

            if (me.Button == System.Windows.Forms.MouseButtons.Left && BoothState == BoothStates.Idle)
            {
                Setup.LogStat(StatTypes.TakingPictures);
                if (CycleFrames)
                {
                    NextFrame(false);
                }
                BoothState = BoothStates.GetReady;
                //drawLatestImage(null, new PaintEventArgs(this.Get
                //this.Repa
                secondsRemaining = 2;
                roundsRemaining  = Rounds;
                ImagesSaved      = new List <string>();
                NextTickDate     = DateTime.Now.AddSeconds(1);
                //PictureTimer = new Timer();
                //PictureTimer.Interval = 1000;
                //PictureTimer.Tick += new EventHandler(t_Tick);
                //PictureTimer.Start();
            }
            else if (me.Button == System.Windows.Forms.MouseButtons.Right && BoothState != BoothStates.TakePicture)
            {
                NextFrame(true);
            }
        }
Exemplo n.º 4
0
        public void StartCamera(string cameraID)
        {
            try
            {
                BoothState   = BoothStates.WaitingForCamera;
                _latestFrame = null;
                pictureBoxDisplay.Invalidate();

                StopCamera();

                CameraDeviceID = cameraID;

                // create video source
                CaptureDevice localSource = new CaptureDevice();
                localSource.VideoSource = CameraDeviceID;

                // open it
                OpenVideoSource(localSource);
            }
            catch (Exception ex)
            {
                Setup.Log("StartCamera Exception", ex);
                Setup.LogStat(StatTypes.Error, "StartCamera Exception");
                MessageBox.Show(this, "Could not start camera!  Please send us your Log.txt file for troubleshooting", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 5
0
 static void Main()
 {
     Setup.Log("Starting application");
     Setup.LogStat(StatTypes.Launch);
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new CameraForm());
 }
Exemplo n.º 6
0
 private void BTN_ViewImages_Click(object sender, EventArgs e)
 {
     try
     {
         Setup.LogStat(StatTypes.ViewImagesSimple);
         Process.Start(Settings.ImagePath);
     }
     catch (Exception ex)
     {
         Setup.Log("Could not open imagesPath", ex);
         Setup.LogStat(StatTypes.Error, "ViewImages (SimpleMode) Exception");
     }
 }
Exemplo n.º 7
0
 private void BTN_Advanced_Click(object sender, EventArgs e)
 {
     try
     {
         Setup.LogStat(StatTypes.AdvancedMode);
         this.Hide();
         CameraForm.Instance.LastSetupForm = CameraForm.Instance.SetupForm;
         CameraForm.Instance.SetupForm.Show();
     }
     catch (Exception ex)
     {
         Setup.Log("Could not goto advanced mode", ex);
         Setup.LogStat(StatTypes.Error, "GotoAdvancedMode Exception");
     }
 }
Exemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            Setup.LogStat(StatTypes.StartPhotoBoothAdvanced);
            try
            {
                string imagesPath = TB_ImagePath.Text.Trim();
                if (String.IsNullOrEmpty(imagesPath))
                {
                    throw new Exception("missing imagespath");
                }
                if (!Directory.Exists(imagesPath))
                {
                    Directory.CreateDirectory(imagesPath);
                }

                string overlaysPath = TB_Overlays.Text.Trim();
                if (String.IsNullOrEmpty(overlaysPath))
                {
                    throw new Exception("missing overlayspath");
                }
                if (!Directory.Exists(overlaysPath))
                {
                    Directory.CreateDirectory(overlaysPath);
                }

                Settings.ImagePath        = imagesPath;
                Settings.OverlaysPath     = overlaysPath;
                Settings.CycleOverlays    = CB_CycleFrames.Checked;
                Settings.Rounds           = (int)NUD_Rounds.Value;
                Settings.SecondsToPreview = (int)NUD_SecondsToPreview.Value;
                Settings.SecondsToWait    = (int)NUD_SecondsToWait.Value;

                MessageBox.Show(this, "Photo Booth will now start.  Press the 'Q' key to leave at any time.", "About to start...", MessageBoxButtons.OK, MessageBoxIcon.Information);

                Log("Starting photo booth from advanced mode:\r\n\tImagePath: " + Settings.ImagePath + "\r\n\tOverlaysPath: " + Settings.OverlaysPath + "\r\n\tRounds: " + Settings.Rounds + "\r\n\tSecondsToWait: " + Settings.SecondsToWait + "\r\n\tSecondsToPreview: " + Settings.SecondsToPreview);

                this.Hide();
                CameraForm.Instance.ReloadSettings();
                CameraForm.Instance.StartCamera(cameraFilters[DDL_VideoCamera.SelectedIndex].MonikerString);
                CameraForm.Instance.Show();
            }
            catch (Exception ex)
            {
                Log("cannot start", ex);
                Setup.LogStat(StatTypes.Error, "StartPhotoBooth (Advanced) Exception");
                MessageBox.Show(this, "Please double check your settings!", "Missing Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 9
0
        private void Setup_Load(object sender, EventArgs e)
        {
            try
            {
                TB_ImagePath.Text          = Settings.ImagePath;
                TB_Overlays.Text           = Settings.OverlaysPath;
                NUD_Rounds.Value           = Settings.Rounds;
                NUD_SecondsToPreview.Value = Settings.SecondsToPreview;
                NUD_SecondsToWait.Value    = Settings.SecondsToWait;
                CB_CycleFrames.Checked     = Settings.CycleOverlays;

                try
                {
                    cameraFilters = new FilterCollection(FilterCategory.VideoInputDevice);
                }
                catch (Exception exc)
                {
                    Log("Could not retrieve camera devices", exc);
                }

                if (cameraFilters == null || cameraFilters.Count == 0)
                {
                    Setup.LogStat(StatTypes.Error, "No cameras found (AdvancedMode)");
                    DDL_VideoCamera.Items.Add("NO CAMERAS FOUND");
                    BTN_Start.Enabled = false;
                }
                else
                {
                    foreach (Filter filter in cameraFilters)
                    {
                        DDL_VideoCamera.Items.Add(filter.Name);
                    }
                }
                DDL_VideoCamera.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                Log("Cannot load setup form", ex);
                Setup.LogStat(StatTypes.Error, "Setup_Load Exception");
                MessageBox.Show(this, "Could not start application!  Please send us your Log.txt file for troubleshooting", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 10
0
        private void BTN_Start_Click(object sender, EventArgs e)
        {
            try
            {
                Setup.LogStat(StatTypes.StartPhotoBoothSimple);
                MessageBox.Show(this, "Photo Booth will now start.  Press the 'Q' key to leave at any time.", "About to start...", MessageBoxButtons.OK, MessageBoxIcon.Information);

                Setup.Log("Starting photo booth from simple mode:\r\n\tImagePath: " + Settings.ImagePath + "\r\n\tOverlaysPath: " + Settings.OverlaysPath + "\r\n\tRounds: " + Settings.Rounds + "\r\n\tSecondsToWait: " + Settings.SecondsToWait + "\r\n\tSecondsToPreview: " + Settings.SecondsToPreview);

                this.Hide();
                CameraForm.Instance.ReloadSettings();
                CameraForm.Instance.StartCamera(cameraFilters[0].MonikerString);
                CameraForm.Instance.Show();
            }
            catch (Exception ex)
            {
                Setup.Log("Could not start photobooth", ex);
                Setup.LogStat(StatTypes.Error, "StartPhotoBooth (SimpleMode) Exception");
            }
        }
Exemplo n.º 11
0
        private void button4_Click(object sender, EventArgs e)
        {
            string imagesPath = TB_ImagePath.Text.Trim();

            try
            {
                if (!String.IsNullOrEmpty(imagesPath))
                {
                    if (!Directory.Exists(imagesPath))
                    {
                        Directory.CreateDirectory(imagesPath);
                    }
                    Process.Start(imagesPath);
                }
            }
            catch (Exception ex)
            {
                Log("Could not open imagesPath", ex);
                Setup.LogStat(StatTypes.Error, "ViewImages (Advanced) Exception");
                MessageBox.Show(this, "Please double check your settings!", "Missing Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 12
0
 private void pictureBox1_Click(object sender, EventArgs e)
 {
     Setup.LogStat(StatTypes.WebsiteClick);
     System.Diagnostics.Process.Start("http://www.justmeasuringup.com");
 }
Exemplo n.º 13
0
        private void CameraForm_Load(object sender, EventArgs e)
        {
            try
            {
                Instance = this;

                pictureBoxDisplay.Paint += new PaintEventHandler(drawLatestImage);

                this.Hide();


                SplashForm = new Splash();
                SplashForm.Show();

                /*
                 * if (CameraService.AvailableCameras.Count == 0)
                 * {
                 *  Setup.Log("CameraForm_Load NO WEB CAMS FOUND");
                 *  MessageBox.Show(this, "Sorry!  We could not detect a web camera.  Are you sure it's plugged in?\n\nDouble check your web camera settings and try \"easy Photo Booth\" again.", "No web camera detected", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                 *  Application.Exit();
                 * }
                 */

                SplashTimer          = new Timer();
                SplashTimer.Interval = 5000;
                SplashTimer.Tick    += timer_Tick;
                SplashTimer.Start();

                //SetupForm = new Setup();
                //SetupForm.Show();

                SND_CameraClick = new SoundPlayer(Properties.Resources.CameraClick);
                SND_CameraClick.Load();
                SND_Tick = new SoundPlayer(Properties.Resources.Tick);
                SND_Tick.Load();
                SND_Smile = new SoundPlayer(Properties.Resources.FastTick);
                SND_Smile.Load();



                Setup.Log("Current directory: " + Directory.GetCurrentDirectory());

                /*
                 * if (!DesignMode)
                 * {
                 *  // Refresh the list of available cameras
                 *  comboBoxCameras.Items.Clear();
                 *  foreach (Camera cam in CameraService.AvailableCameras)
                 *      comboBoxCameras.Items.Add(cam);
                 *
                 *  if (comboBoxCameras.Items.Count > 0)
                 *      comboBoxCameras.SelectedIndex = 0;
                 *
                 *  ReloadSettings();
                 *
                 *  if (comboBoxCameras.Items.Count > 0)
                 *  {
                 *      CameraFound = true;
                 *
                 *      // start camera
                 *      if (_frameSource != null && _frameSource.Camera == comboBoxCameras.SelectedItem)
                 *          return;
                 *
                 *      thrashOldCamera();
                 *      startCapturing();
                 *  }
                 *  else
                 *  {
                 *      pictureBoxDisplay.Visible = false;
                 *      _latestFrame = new Bitmap(pictureBoxDisplay.Width, pictureBoxDisplay.Height);
                 *  }
                 * }
                 * */
            }
            catch (Exception ex)
            {
                Setup.Log("CameraForm_Load Exception", ex);
                Setup.LogStat(StatTypes.Error, "CameraForm_Load Exception");
                MessageBox.Show(this, "Could not start application!  Please send us your Log.txt file for troubleshooting", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                Application.Exit();
            }
        }