示例#1
0
文件: Form1.cs 项目: imressed/SSO
        private void Form1_Load(object sender, EventArgs e)
        {
            //turn on the lights
            FlashLighter.RunWorkerAsync();

            //select camera to get real-time image from phone display
            CameraSelection cselect = new CameraSelection();
            DialogResult    dresult = cselect.ShowDialog();

            if (dresult == DialogResult.OK)
            {
                try
                {
                    imageReceiver = new ImageReceiver(cselect.camNumber);
                }
                catch (NullReferenceException exception)
                {
                    MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.Close();
                }
                getStreamVideoFromWebCam();
            }
            else
            {
                this.Close();
            }

            //select COM-port for phone manipulation
            COMSelection cmselect = new COMSelection();

            dresult = cmselect.ShowDialog();
            if (dresult == DialogResult.OK)
            {
                manipulator = new Manipulator(cmselect.portName);
            }
            else
            {
                this.Close();
            }
        }
示例#2
0
文件: Form1.cs 项目: bmwant/SSO
        private void Form1_Load(object sender, EventArgs e)
        {
            //turn on the lights
            FlashLighter.RunWorkerAsync();

            //select camera to get real-time image from phone display
            CameraSelection cselect = new CameraSelection();
            DialogResult dresult = cselect.ShowDialog();
            if (dresult == DialogResult.OK)
            {
                try
                {
                    imageReceiver = new ImageReceiver(cselect.camNumber);
                }
                catch (NullReferenceException exception)
                {
                    MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.Close();
                }
                getStreamVideoFromWebCam();
            }
            else
            {
                this.Close();
            }

            //select COM-port for phone manipulation
            COMSelection cmselect = new COMSelection();
            dresult = cmselect.ShowDialog();
            if (dresult == DialogResult.OK)
            {
                manipulator = new Manipulator(cmselect.portName);
            }
            else
            {
                this.Close();
            }
        }