コード例 #1
0
        private void catchPictureToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (m_nIndex > -1 && m_iPlayhandle > 0)
            {
                String     strPath;
                ClientDemo clientdemo = (ClientDemo)this.Parent;
                foreach (TreeNode node in clientdemo.devForm.DevTree.Nodes)
                {
                    if (node.Name == "Device")
                    {
                        foreach (TreeNode channelnode in node.Nodes)
                        {
                            if (channelnode.Name == "Channel")
                            {
                                CHANNEL_INFO chInfo = (CHANNEL_INFO)channelnode.Tag;
                                if (chInfo.nWndIndex == m_nIndex)
                                {
                                    int y   = System.DateTime.Now.Year;
                                    int m   = System.DateTime.Now.Month;
                                    int d   = System.DateTime.Now.Day;
                                    int h   = System.DateTime.Now.Hour;
                                    int min = System.DateTime.Now.Minute;
                                    int s   = System.DateTime.Now.Second;
                                    strPath = String.Format(".\\Pictures\\{0}_{1}_{2}{3}{4}{5}{6}{7}.bmp", node.Text, chInfo.nChannelNo + 1, y, m, d, h, min, s);
                                    bool bCatch = XMSDK.H264_DVR_LocalCatchPic(m_iPlayhandle, strPath);

                                    if (bCatch)
                                    {
                                        System.Diagnostics.Process.Start(strPath);
                                    }
                                    else
                                    {
                                        MessageBox.Show("Catch Picture error !");
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }