private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            Gestura new_form = new Gestura();

            new_form.Show();
            //Application.OpenForms[0].Opacity = 0.89;
        }
        private void tick(object sender, EventArgs e)
        {
            if (flag == 1)
            {
                if (this.Opacity < 1)
                {
                    this.Opacity += 0.02;
                }
                else
                {
                    timer1.Stop();
                    flag  = 0;
                    flag2 = 1;

                    /*speaker.Rate = 1;
                     * speaker.Volume = 100;
                     * speaker.Speak("Welcome to Gestuelle.");*/

                    timer2.Start();
                }
            }
            else
            {
                timer2.Stop();
                timer1.Start();
                if (this.Opacity > 0)
                {
                    this.Opacity -= 0.04;
                }
                else
                {
                    timer1.Stop();
                    //this.Close();
                    Gestura new_form = new Gestura();
                    new_form.Show();
                    this.Hide();
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void timer3_Tick(object sender, EventArgs e)
        {
            String num, temp2, temp;

            for (int i = 0; i < 5; i++)
            {
                Cursor.Current = Cursors.WaitCursor;

                // Release any previous buffer
                if (m_ip != IntPtr.Zero)
                {
                    Marshal.FreeCoTaskMem(m_ip);
                    m_ip = IntPtr.Zero;
                }

                // capture image
                m_ip = cam[prog_iterations].Click();

                Bitmap b = new Bitmap(cam[prog_iterations].Width, cam[prog_iterations].Height, cam[prog_iterations].Stride, PixelFormat.Format24bppRgb, m_ip);
                Bitmap c = new Bitmap(b, 128, 128);

                // If the image is upsidedown
                c.RotateFlip(RotateFlipType.RotateNoneFlipY);
                cnt_scan++;
                label2.Text = cnt_scan.ToString();
                temp2       = ".jpg";
                temp        = "D:\\Images\\frame";
                num         = clicks.ToString();
                temp2       = num + temp2;
                temp        = temp + temp2;
                c.Save(temp);
                b.Dispose();
                c.Dispose();
                GC.Collect();
                if (clicks % 4 == 0)
                {
                    Step_A(clicks);
                    Step_B(clicks);
                    Step_C(clicks);
                }
                if (clicks <= 4)
                {
                    Thread.Sleep(200);
                }
                else
                {
                    Thread.Sleep(125);
                }

                clicks++;
                if (clicks >= 30)
                {
                    break;
                }
            }
            Cursor.Current = Cursors.Default;

            if (clicks >= 28)
            {
                timer3.Stop();
                pattern_recognition();
                cam[prog_iterations].Dispose();
                this.Dispose();
                this.Close();
                prog_iterations++;
                Gestura new_form = new Gestura();
                new_form.Show();
            }
        }