/// <summary>
        /// Initializes the capture monitors.
        /// </summary>
        private void InitializeCaptureMonitors()
        {
            var factory = new Factory1();

            for (int i = 0; i < factory.GetAdapterCount(); i++)
            {
                for (int j = 0; j < factory.GetAdapter(i).GetOutputCount(); j++)
                {
                    var output = factory.GetAdapter(i).GetOutput(j);

                    CaptureSettings settings = new CaptureSettings();
                    settings.m_Adapter = i;
                    settings.m_Output  = j;
                    settings.m_Rect    = new DsRect(
                        output.Description.DesktopBounds.Left,
                        output.Description.DesktopBounds.Top,
                        output.Description.DesktopBounds.Right,
                        output.Description.DesktopBounds.Bottom
                        );

                    CaptureItem captureItem = new CaptureItem(output.Description.DeviceName, settings);
                    captureMethodCombo.Items.Add(captureItem);
                }
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            var factory = new Factory1();

            for (var i = 0; i < factory.GetAdapterCount(); i++)
            {
                var adapter = factory.GetAdapter(i);
                Console.WriteLine(adapter.Description.Description.Trim('\0') + ":");
                for (var j = 0; j < adapter.Outputs.Length; j++)
                {
                    var output = adapter.Outputs[j];
                    Console.WriteLine(output.Description.DeviceName);
                    Console.WriteLine("Desktop: " + output.Description.IsAttachedToDesktop);
                    Console.WriteLine("Bounds: " + output.Description.DesktopBounds.Right);
                }
                Console.WriteLine();
            }

            var wnd = new AdapterConfig();

            wnd.ShowDialog();
        }
Пример #3
0
        public static List <DxEnumeratedAdapter> GetAdapters()
        {
            var displays = new List <DxEnumeratedAdapter>();

            try
            {
                using var factory = new Factory1();
                var adapterCount = factory.GetAdapterCount();
                for (var i = 0; i < adapterCount; ++i)
                {
                    using var adapter = factory.GetAdapter1(i);
                    displays.Add(new DxEnumeratedAdapter()
                    {
                        AdapterId = i,
                        Name      = adapter.Description1.Description
                    });
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            return(displays);
        }