Esempio n. 1
0
        public ChooseOutput(Adapter1 adapter, string selectedDeviceName)
        {
            InitializeComponent();
            Icon = Main.EmbeddedIcon;

            listViewMain.Select();
            foreach (var output in adapter.Outputs)
            {
                string name = DuplicatorOptions.GetDisplayDeviceName(output.Description.DeviceName);
                var    item = listViewMain.Items.Add(name);
                item.Tag = output.Description.DeviceName;
                int width  = output.Description.DesktopBounds.Right - output.Description.DesktopBounds.Left;
                int height = output.Description.DesktopBounds.Bottom - output.Description.DesktopBounds.Top;
                item.SubItems.Add(width + " x " + height);
                item.SubItems.Add(output.Description.DesktopBounds.Left + ", " + output.Description.DesktopBounds.Top);
                item.SubItems.Add(output.Description.Rotation.ToString());
                if (selectedDeviceName != null && output.Description.DeviceName == selectedDeviceName)
                {
                    DeviceName    = name;
                    item.Selected = true;
                }
            }

            listViewMain.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            UpdateControls();
            Text = "Choose Monitor for " + adapter.Description.Description;
        }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        _options = new DuplicatorOptions();
        _options.CaptureMicrophone = false;
        Debug.Log(_options.GetAdapter().Description.DeviceId);
        _options.Adapter = "NVIDIA GeForce GTX 1080";

        _duplicator = new Duplicator.Duplicator(_options);
        _duplicator.PropertyChanged      += OnDuplicatorPropertyChanged;
        _duplicator.InformationAvailable += OnDuplicatorInformationAvailable;
        _duplicator.Size = new SharpDX.Size2(500, 300);

        _duplicator.StartDuplicating();
    }