コード例 #1
0
        private void toolStripButton_preview_stop_Click(object sender, EventArgs e)
        {
            if (null != video)
            {
                eloamView.SetText(null, 0);
                video.Destroy();
                video = null;
            }

            eloamView.SetText(null, 0);

            Reset();

            this.toolStripButton_preview_start.Enabled = true;
            this.toolStripButton_preview_stop.Enabled  = false;
        }
コード例 #2
0
        private void toolStripButton_preview_start_Click(object sender, EventArgs e)
        {
            int    devIdx        = selectDevice.SelectedIndex;
            string curModeString = selectMode.SelectedItem.ToString();
            int    modeIdx       = (curModeString == "YUY2" ? 1 :
                                    (curModeString == "MJPG" ? 2 :
                                     (curModeString == "UYVY" ? 4 :
                                      -1)));
            int resIdx = selectResolution.SelectedIndex;

            if (-1 != devIdx)
            {
                if (null != video)
                {
                    video.Destroy();
                    video = null;
                }

                EloamDevice tempDevice = deviceList[devIdx];
                video = (EloamVideo)tempDevice.CreateVideo(resIdx, modeIdx);

                if (null != video)
                {
                    eloamView.SelectVideo(video);
                    eloamView.SetText("打开视频中,请等待...", RGB(255, 255, 255));

                    selectDevice.Enabled     = false;
                    selectResolution.Enabled = false;
                    selectMode.Enabled       = false;

                    //openVideo.Enabled = false;
                    //closeVideo.Enabled = true;
                }
            }

            this.toolStripButton_preview_start.Enabled = false;
            this.toolStripButton_preview_stop.Enabled  = true;
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: renyh1013/dp2
        private void toolStripButton_preview_stop_Click(object sender, EventArgs e)
        {
            if (null != video)
            {
                eloamView.SetText(null, 0);
                video.Destroy();
                video = null;
            }

            eloamView.SetText(null, 0);

            Reset();

            this.toolStripButton_preview_start.Enabled = true;
            this.toolStripButton_preview_stop.Enabled = false;
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: renyh1013/dp2
        private void toolStripButton_preview_start_Click(object sender, EventArgs e)
        {
            int devIdx = selectDevice.SelectedIndex;
            string curModeString = selectMode.SelectedItem.ToString();
            int modeIdx = (curModeString == "YUY2" ? 1 :
                            (curModeString == "MJPG" ? 2 :
                                (curModeString == "UYVY" ? 4 :
                                    -1)));
            int resIdx = selectResolution.SelectedIndex;

            if (-1 != devIdx)
            {
                if (null != video)
                {
                    video.Destroy();
                    video = null;
                }

                EloamDevice tempDevice = deviceList[devIdx];
                video = (EloamVideo)tempDevice.CreateVideo(resIdx, modeIdx);

                if (null != video)
                {
                    eloamView.SelectVideo(video);
                    eloamView.SetText("打开视频中,请等待...", RGB(255, 255, 255));

                    selectDevice.Enabled = false;
                    selectResolution.Enabled = false;
                    selectMode.Enabled = false;

                    //openVideo.Enabled = false;
                    //closeVideo.Enabled = true;
                }
            }

            this.toolStripButton_preview_start.Enabled = false;
            this.toolStripButton_preview_stop.Enabled = true;
        }