Пример #1
0
        private void RemoteDisplayCBFun(int nPort, IntPtr pBuf, int nSize, int nWidth, int nHeight, int nStamp, int nType, int nReserved)
        {
            try
            {
                if (!m_bJpegCapture)
                {
                    return;
                }
                else
                {
                    uint nLastErr = 100;
                    // save picture as you want
                    if (!PlayCtrl.PlayM4_ConvertToJpegFile(pBuf, nSize, nWidth, nHeight, nType, "C:/Capture.jpg"))
                    {
                        nLastErr = PlayCtrl.PlayM4_GetLastError(nPort);  //m_Channel
                    }
                    else
                    {
                    }
                }

                m_bJpegCapture = false;
            }
            catch (Exception ex)
            { }
        }
        public void RemoteDisplayCBFun(int nPort, IntPtr pBuf, int nSize, int nWidth, int nHeight, int nStamp, int nType, int nReserved)
        {
            //MyDebugInfo AlarmInfo = new MyDebugInfo(DebugInfo);
            if (!m_bJpegCapture)
            {
                return;
            }
            else
            {
                uint nLastErr = 100;
                // save picture as you want
                if (!PlayCtrl.PlayM4_ConvertToJpegFile(pBuf, nSize, nWidth, nHeight, nType, "C:/Capture.jpg"))
                {
                    //Debug.WriteLine("PlayM4_ConvertToJpegFile fail");
                    nLastErr = PlayCtrl.PlayM4_GetLastError(m_lPort);
                    //this.BeginInvoke(AlarmInfo, "Jpeg Capture fail");
                }
                else
                {
                    // this.BeginInvoke(AlarmInfo, "Jpeg Capture Succ");
                    //Debug.WriteLine("PlayM4_ConvertToJpegFile Succ");
                }
            }

            m_bJpegCapture = false;
        }