Пример #1
0
 public void SetSelectedScreen(string displayName)
 {
     if (displayName == SelectedScreen)
     {
         return;
     }
     try
     {
         if (_x11Screens.ContainsKey(displayName))
         {
             SelectedScreen = displayName;
         }
         else
         {
             SelectedScreen = _x11Screens.Keys.First();
         }
         var width  = LibX11.XDisplayWidth(Display, _x11Screens[SelectedScreen]);
         var height = LibX11.XDisplayHeight(Display, _x11Screens[SelectedScreen]);
         CurrentScreenBounds = new Rectangle(0, 0, width, height);
         CaptureFullscreen   = true;
         ScreenChanged?.Invoke(this, CurrentScreenBounds);
     }
     catch (Exception ex)
     {
         Logger.Write(ex);
     }
 }
Пример #2
0
 public void SetSelectedScreen(int screenNumber)
 {
     if (screenNumber == SelectedScreen)
     {
         return;
     }
     try
     {
         if (GetScreenCount() >= screenNumber + 1)
         {
             SelectedScreen = screenNumber;
         }
         else
         {
             SelectedScreen = 0;
         }
         var width  = LibX11.XDisplayWidth(Display, SelectedScreen);
         var height = LibX11.XDisplayHeight(Display, SelectedScreen);
         CurrentScreenBounds = new Rectangle(0, 0, width, height);
         CaptureFullscreen   = true;
         Init();
         ScreenChanged?.Invoke(this, CurrentScreenBounds);
     }
     catch (Exception ex)
     {
         Logger.Write(ex);
     }
 }