Exemplo n.º 1
0
 public void OnResizeDialog()
 {
     foreach (OneDialog dlg in m_dialogs)
     {
         BVRect rect = new BVRect();
         rect.left   = dlg.panel.DisplayRectangle.Left;
         rect.top    = dlg.panel.DisplayRectangle.Top;
         rect.right  = dlg.panel.DisplayRectangle.Right;
         rect.bottom = dlg.panel.DisplayRectangle.Bottom;
         BVCU.ManagedLayer_CuResizeDialogWindow(m_bvsdkHandle, dlg.dialogHandle, ref rect);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 打开对话(Dialog)
        /// </summary>
        /// <param name="pu"></param>
        /// <param name="channelNo"></param>
        /// <param name="panel"></param>
        public void openBrowse(Pu pu, int channelNo, Panel panel)
        {
            try
            {
                BVCU_DialogControlParam_Network net = new BVCU_DialogControlParam_Network(0, 5, 1, 3);
                BVRect    dispRect = new BVRect(0, 0, panel.ClientRectangle.Height, panel.ClientRectangle.Width);
                OneDialog dlg      = new OneDialog();

                foreach (Channel channel in pu.channelList)
                {
                    int volume = -1;
                    if (channel.channelNo == channelNo)
                    {
                        if (channel.audioPlayback)
                        {
                            volume = 0;
                        }
                        //打开视屏浏览, 主要参数:sdkHandle、sessionHandle、puID、channelNo、显示区域的大小
                        int ret = BVCU.ManagedLayer_CuBrowsePu(m_bvsdkHandle,                 //sdk handle
                                                               ref dlg.dialogHandle,          //dialog handle
                                                               m_session.Handle,              //session handle
                                                               Encoding.UTF8.GetBytes(pu.id), //pu id
                                                               channelNo,                     //channel no
                                                               panel.Handle,                  //pannel handle
                                                               ref dispRect,                  //上下左右,矩形
                                                               volume,                        //音量
                                                               0,                             //single Rec File Sec
                                                               Encoding.UTF8.GetBytes(""),    //rec File Dir
                                                               true,                          //videoTrans
                                                               ref net,                       //network 时延
                                                               m_bvsdkEventHandler.dialog_OnDialogEvent,
                                                               m_bvsdkEventHandler.dialog_OnStorageEvent);

                        BVCU.FAILED(ret);
                        LogHelper.LogHelper.RecordLog(4, string.Format("打开[{0}, {1}]的视屏预览通道", pu.puName, channelNo));

                        break;
                    }
                }

                dlg.panel     = panel;
                dlg.pu        = pu;
                dlg.channelNo = channelNo;
                m_dialogs.Add(dlg);
            }
            catch
            {
                panel.ContextMenuStrip = null;
                MessageBox.Show("打开预览失败");
            }
        }
Exemplo n.º 3
0
        public void openTalkOnly(Pu pu, int channelNo, Panel panel)
        {
            try
            {
                BVCU_DialogControlParam_Network net = new BVCU_DialogControlParam_Network(0, 5, 1, 3);
                BVRect    dispRect = new BVRect(0, 0, panel.ClientRectangle.Height, panel.ClientRectangle.Width);
                OneDialog dlg      = new OneDialog();

                foreach (Channel channel in pu.channelList)
                {
                    int captureVolume = 50;
                    int audioVolume   = 50;
                    if (channel.channelNo == channelNo)
                    {
                        int ret = BVCU.ManagedLayer_CuNewTalk(m_bvsdkHandle,
                                                              ref dlg.dialogHandle,
                                                              m_session.Handle,
                                                              Encoding.UTF8.GetBytes(pu.id),
                                                              channelNo,
                                                              captureVolume,
                                                              audioVolume,
                                                              ref net,
                                                              m_bvsdkEventHandler.dialog_OnDialogEvent,
                                                              m_bvsdkEventHandler.dialog_OnStorageEvent);
                        BVCU.FAILED(ret);
                        LogHelper.LogHelper.RecordLog(4, string.Format("打开[{0}]对讲", pu.puName));
                        break;
                    }
                }
                dlg.panel     = panel;
                dlg.pu        = pu;
                dlg.channelNo = channelNo;
                m_dialogs.Add(dlg);
            }
            catch
            {
                panel.ContextMenuStrip = null;
                MessageBox.Show("打开对讲失败");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 视频预览
        /// </summary>
        /// <example>adf</example>
        /// <param name="pu">要预览的设备</param>
        /// <param name="channelNo">通道号</param>
        /// <param name="control">在哪个控件上预览</param>
        public void PreviewVideo(Pu pu, int channelNo, Control control)
        {
            BVCU_DialogControlParam_Network net = new BVCU_DialogControlParam_Network(0, 5, 1, 3);
            OneDialog dlg      = new OneDialog();
            BVRect    dispRect = new BVRect(0, 0, control.ClientRectangle.Height, control.ClientRectangle.Width);

            //打开视屏浏览
            int ret = BVCU.ManagedLayer_CuBrowsePu(m_bvsdkHandle,                 //sdk handle
                                                   ref dlg.dialogHandle,          //dialog handle
                                                   m_session.Handle,              //session handle
                                                   Encoding.UTF8.GetBytes(pu.id), //pu id
                                                   channelNo,                     //channel no
                                                   control.Handle,                //pannel handle
                                                   ref dispRect,                  //上下左右,矩形
                                                   0,                             //音量
                                                   0,                             //single Rec File Sec
                                                   Encoding.UTF8.GetBytes(""),    //rec File Dir
                                                   true,                          //videoTrans
                                                   ref net,                       //network 时延
                                                   m_bvsdkEventHandler.dialog_OnDialogEvent,
                                                   m_bvsdkEventHandler.dialog_OnStorageEvent);
        }
Exemplo n.º 5
0
 public static extern int BVDisplay_DisplayFont(IntPtr hwnd, int fontIdx, ref BVRect dispRect, ref Color color, [MarshalAs(UnmanagedType.LPWStr)] String text);
Exemplo n.º 6
0
 public static extern int ManagedLayer_CuResizeDialogWindow(IntPtr handle, IntPtr dialog, ref BVRect dispRect);
Exemplo n.º 7
0
 public static extern int ManagedLayer_CuBrowsePu(IntPtr handle, ref IntPtr dialog,
                                                  IntPtr session, Byte[] puId, int channelNo, IntPtr hWnd, ref BVRect dispRect,
                                                  int volume, int singleRecFileSec, Byte[] recFileDir, bool videoTrans,
                                                  ref BVCU_DialogControlParam_Network netWork,
                                                  EventHandler.BVCU_Dialog_OnDialogEvent onDlgEvent,
                                                  EventHandler.BVCU_Dialog_OnStorageEvent onStoreEvent);