private void button1_Click(object sender, EventArgs e)
 {
     SDK_HuaMai.hm_video_display_close_port(iPort);
     iPort = IntPtr.Zero;
     SDK_HuaMai.hm_pu_stop_video(iOpenVideo);
     SDK_HuaMai.hm_pu_close_video(iOpenVideo);
     SDK_HuaMai.hm_pu_logout(iDev);
 }
Ejemplo n.º 2
0
 public bool VideoClose()
 {
     SDK_HuaMai.hm_video_display_close_port(iPort);
     iPort = IntPtr.Zero;
     SDK_HuaMai.hm_pu_stop_video(iOpenVideo);
     SDK_HuaMai.hm_pu_close_video(iOpenVideo);
     iOpenVideo = IntPtr.Zero;
     SDK_HuaMai.hm_pu_logout(iDev);
     iDev           = IntPtr.Zero;
     VideoPlayState = Enum_VideoPlayState.NotInPlayState;
     VideoPlayCallback(new VideoPlayCallbackValue {
         evType = Enum_VideoPlayEventType.VideoClose
     });
     return(true);
 }
        private void Frm_Temp_TestVideoPlay_ResizeBegin(object sender, EventArgs e)
        {
            return;

            SDK_HuaMai.hm_video_display_close_port(iPort);
            iPort = IntPtr.Zero;
            SDK_HuaMai.hm_pu_stop_video(iOpenVideo);
            SDK_HuaMai.hm_pu_close_video(iOpenVideo);
            SDK_HuaMai.hm_pu_logout(iDev);
            return;

            //SDK_HuaMai.hm_video_display_stop(iPort);
            intCountResizeBegin++;
            label3.Text = intCountResizeBegin.ToString();
        }
Ejemplo n.º 4
0
        public void hm_pu_logutTest()
        {
            UInt32 iResult = 0;

            Init();
            if (!GetNode_ByIndex(iRootNode, 3))
            {
                Release();
                Assert.Fail();
            }
            IntPtr        iDev   = IntPtr.Zero;
            _CONNECT_INFO config = new _CONNECT_INFO();

            config.ct = CLIENT_TYPE.CT_PC;
            config.cp = CONNECT_PRI.CPI_DEF;
            config.cm = CONNECT_MODE.CM_DEF;
            iResult   = SDK_HuaMai.hm_pu_login_ex(iNode, ref config, ref iDev);
            iResult   = SDK_HuaMai.hm_pu_logout(iDev);
            Release();
            Assert.AreEqual(Convert.ToUInt32(0), iResult);
        }
        private void pictureBox1_SizeChanged(object sender, EventArgs e)
        {
            intCountt++;
            label1.Text = "SizeChanged" + intCountt.ToString();
            return;

            Size Temp_s = pictureBox1.Size;

            if (Math.Abs(s.Width - Temp_s.Width) > 100 || Math.Abs(s.Height - Temp_s.Height) > 100)
            {
                s = Temp_s;
                SDK_HuaMai.hm_video_display_close_port(iPort);
                SDK_HuaMai.hm_pu_stop_video(iOpenVideo);
                SDK_HuaMai.hm_pu_close_video(iOpenVideo);
                SDK_HuaMai.hm_pu_logout(iDev);
                pictureBox1.BackColor = Color.Black;
                if (!GetNode_BySN("E322213C04245"))
                {
                    Release();
                    return;
                }
                if (!LoginDev())
                {
                    Release();
                    return;
                }
                if (!OpenRealVideo())
                {
                    Release();
                    return;
                }
                if (!StartVideo())
                {
                    Release();
                }
                SDK_HuaMai.DISPLAY_OPTION disp_op = new SDK_HuaMai.DISPLAY_OPTION();
                disp_op.dm = SDK_HuaMai.DISPLAY_MODE.HME_DM_DX;
                disp_op.pq = SDK_HuaMai.PIC_QUALITY.HME_PQ_HIGHT;
                //IntPtr iWnd = pictureBox1.Handle;
                iPort = IntPtr.Zero;
                SDK_HuaMai.hm_video_display_open_port(pictureBox1.Handle, ref disp_op, ref iPort);
                SDK_HuaMai.hm_video_display_start(iPort, videoRes.image_width, videoRes.image_height, videoRes.fps);
                intCountt = 0;
                listBox1.Items.Add(iPort.ToString());
            }
            return;

            if (bolFlag)
            {
                bolFlag = false;
                SDK_HuaMai.hm_video_display_stop(iPort);
                SDK_HuaMai.hm_video_display_close_port(iPort);
                //StartOpenVideo();
                SDK_HuaMai.DISPLAY_OPTION disp_op = new SDK_HuaMai.DISPLAY_OPTION();
                disp_op.dm = SDK_HuaMai.DISPLAY_MODE.HME_DM_DX;
                disp_op.pq = SDK_HuaMai.PIC_QUALITY.HME_PQ_HIGHT;
                ////IntPtr iWnd = pictureBox1.Handle;
                SDK_HuaMai.hm_video_display_open_port(pictureBox1.Handle, ref disp_op, ref iPort);
                SDK_HuaMai.hm_video_display_start(iPort, 0, 0, 25);
                bolFlag = true;
            }
        }