private void pictureOK_Click(object sender, EventArgs e)
 {
     this.Visible = false;
     this.Close();
     frmCameraDetect f = new frmCameraDetect();
     f.ShowDialog();
 }
        private void btnOk_Click(object sender, EventArgs e)
        {
            LiveFaceScan.configfile configfile = new  LiveFaceScan.configfile();

            string selected = this.cbCameraList.GetItemText(this.cbCameraList.SelectedItem);
            string cameralist = selected;
            int formatelist = cbFormat.SelectedIndex;
            LiveFaceScan.CameraSetting.CameraName = cameralist;
            LiveFaceScan.CameraSetting.VideoFormat = formatelist;
            LiveFaceScan.CameraSetting.Drive = configfile.GetDrive();
            this.Visible = false;
               // this.Close();
            frmCameraDetect f = new frmCameraDetect();
            f.StartPosition = FormStartPosition.CenterScreen;
               // f.Shown += (s, a) => f.WindowState = FormWindowState.Maximized;
            f.ShowDialog();
        }
        private void pictureSearch_Click(object sender, EventArgs e)
        {
            //string strapppath = "D:\\Kiosk_Image_Search\\imagecompare.jpg";// System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\imagesearch\\imagecompare.jpg";
            //if (System.IO.File.Exists(strapppath.Replace("\\", "/")))
            //{
            //    System.IO.File.Delete(strapppath.Replace("\\", "/"));
            //}

            //pictureBox1.Image.Save(strapppath.Replace("\\", "/"), ImageFormat.Jpeg);
            //pictureBox1.Dispose();
            //pictureBox1.Refresh();
            needClose = true;
            Image img;
            string file = LiveFaceScan.CameraSetting.Drive + ":\\Kiosk_Image_Search\\imagecompare.jpg";
            using (Bitmap bmp = new Bitmap(file))
            {
                img = new Bitmap(bmp);
                // pictureBox1.Image = img;
            }
            if (System.IO.File.Exists(file))
            {
                System.IO.File.Delete(file);
                pictureBox1.Image.Save(file, ImageFormat.Jpeg);
            }
            else
            pictureBox1.Image.Save(file, ImageFormat.Jpeg);

            if (CheckFile() == true)
            {
                pictureSearch.Visible = false;

                Progresss();

            }
            else {
                Dialog.frmDialogMsg msg = new Dialog.frmDialogMsg();
                msg.lblText.Text = "ไม่พบข้อมูล";
                msg.ShowDialog();
                //needClose = false;
                //PopulateData();
                this.Visible = false;
                this.Close();
                frmCameraDetect f = new frmCameraDetect();
                f.ShowDialog();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            //Image img;
            //string file = @"D:\Kiosk_Image_Search\imagecompare.jpg";
            //using (Bitmap bmp = new Bitmap(file))
            //{
            //    img = new Bitmap(bmp);
            //    // pictureBox1.Image = img;
            //}
            //if (System.IO.File.Exists(file))
            //{
            //    System.IO.File.Delete(file);
            //    pictureBox1.Image.Save(file, ImageFormat.Jpeg);
            //}
            //else
            //    pictureBox1.Image.Save(file, ImageFormat.Jpeg);

            //if (CheckFile() == true)
            //{
            //    pictureSearch.Visible = false;

            //    Progresss();

            //}
            //else
            //{
            //    MessageBox.Show("กรุณาถ่ายรูปใหม่ค่ะ");
            //    //needClose = false;
            //    //PopulateData();
            //    this.Visible = false;
            //    this.Close();
            //    frmCameraDetect f = new frmCameraDetect();
            //    f.ShowDialog();
            //}

            needClose = true;
            Image img;
            string file = LiveFaceScan.CameraSetting.Drive + ":\\Kiosk_Image_Search\\imagecompare.jpg";
            using (Bitmap bmp = new Bitmap(file))
            {
                img = new Bitmap(bmp);
                // pictureBox1.Image = img;
            }
            if (System.IO.File.Exists(file))
            {
                System.IO.File.Delete(file);
                pictureBox1.Image.Save(file, ImageFormat.Jpeg);
            }
            else
                pictureBox1.Image.Save(file, ImageFormat.Jpeg);

            if (CheckFile() == true)
            {
                pictureSearch.Visible = false;

                Progresss();

            }
            else
            {
                Dialog.frmDialogMsg msg = new Dialog.frmDialogMsg();
                msg.lblText.Text = "ไม่พบข้อมูล";
                msg.ShowDialog();
                //needClose = false;
                //PopulateData();
                this.Visible = false;
                this.Close();
                frmCameraDetect f = new frmCameraDetect();
                f.ShowDialog();
            }
        }
 private void button1_Click(object sender, EventArgs e)
 {
     this.Close();
     frmCameraDetect f = new frmCameraDetect();
     f.ShowDialog();
 }