예제 #1
0
        private void InitVideoFeeds()
        {
            try
            {
                int col = 0, row = 0;
                for (int i = 0; i < 4; i++)
                {
                    System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
                    m_obj       = new AplusVideoC01.wpf_Monitor();
                    host.Width  = (int)grid_main.ColumnDefinitions[col].ActualWidth;
                    host.Height = (int)grid_main.RowDefinitions[row].ActualHeight + (int)grid_main.RowDefinitions[row + 1].ActualHeight;

                    row  = i / 2;
                    row *= 2;

                    host.Child = m_obj;
                    host.SetValue(Grid.RowProperty, row);
                    host.SetValue(Grid.ColumnProperty, col);

                    col++; if (col == 2)
                    {
                        col = 0;
                    }

                    grid_main.Children.Add(host);
                    m_obj.Device_Login(host_ip, host_port, "", "");

                    int id = i;
                    if (i == 0)
                    {
                        id = 1;
                    }
                    if (i == 1)
                    {
                        id = 0;
                    }
                    if (i == 2)
                    {
                        id = 3;
                    }
                    if (i == 3)
                    {
                        id = 2;
                    }

                    m_obj.Device_RealPlay(id, 0, 0);
                    m_objList.Add(m_obj);
                    hostList.Add(host);
                }
            }
            catch (Exception ee)
            {
                Console.WriteLine("Video Windows set up error");
            }
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (m_Loaded == false)
     {
         try
         {
             System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
             m_obj      = new AplusVideoC01.wpf_Monitor();
             host.Child = m_obj;
             host.SetValue(Grid.RowProperty, 1);
             grid_main.Children.Add(host);
             m_obj.Device_Login(tb_host.Text, tb_port.Text, "", "");
             m_obj.CapturePictureComplete += new AplusVideoC01.wpf_Monitor.CapturePictureCompleteHandler(m_obj_CapturePictureComplete);
         }
         catch (Exception ee)
         {
         }
     }
 }