示例#1
0
        public static ChangeSettingsResult ChangeResolutionPermanently(RotateDesktopMode rotMode)
        {
            DisplayScreen screen = new DisplayScreen();

            screen.ScreenRotation = rotMode;
            return(screen.UpdateSettingsInRegistry());
        }
示例#2
0
 public static ChangeSettingsResult ChangeResolutionPermanently(int width, int height, RotateDesktopMode rotMode)
 {
     DisplayScreen screen = new DisplayScreen();
     screen.ScreenWidth = width;
     screen.ScreenHeight = height;
     screen.ScreenRotation = rotMode;
     return screen.UpdateSettingsInRegistry();
 }
示例#3
0
        public static ChangeSettingsResult ChangeResolutionTemporary(int width, int height, RotateDesktopMode rotMode)
        {
            DisplayScreen screen = new DisplayScreen();

            screen.ScreenWidth    = width;
            screen.ScreenHeight   = height;
            screen.ScreenRotation = rotMode;
            return(screen.UpdateSettingsToFullscreen());
        }
示例#4
0
        public static ChangeSettingsResult ChangeResolutionPermanently(int width, int height, RotateDesktopMode rotMode)
        {
            DisplayScreen screen = new DisplayScreen();

            screen.ScreenWidth    = width;
            screen.ScreenHeight   = height;
            screen.ScreenRotation = rotMode;
            return(screen.UpdateSettingsInRegistry());
        }
示例#5
0
 /// <summary>
 /// Create a display screen object with the given settings. 
 /// If a setting is not given it will be used the current setting
 /// </summary>
 /// <param name="width">Screen width</param>
 /// <param name="height">Screen height</param>
 /// <param name="mode">Screen rotation mode</param>
 public DisplayScreen(int width, int height, RotateDesktopMode mode)
     : this()
 {
     Initialize(width, height, null, null, mode);
 }
示例#6
0
 /// <summary>
 /// Create a display screen object with the given settings. 
 /// If a setting is not given it will be used the current setting
 /// </summary>
 /// <param name="width">Screen width</param>
 /// <param name="height">Screen height</param>
 /// <param name="frequency">Screen frequency</param>
 /// <param name="color">Screen color mode</param>
 /// <param name="mode">Screen rotation mode</param>
 public DisplayScreen(int width, int height, int frequency, short color, RotateDesktopMode mode)
     : this()
 {
     Initialize(width, height, frequency, color, mode);
 }
示例#7
0
 private void Initialize(int? width, int? height, int? frequency, short? color, RotateDesktopMode? mode)
 {
     if (height.HasValue)
         ScreenHeight = height.Value;
     if (width.HasValue)
         ScreenWidth = width.Value;
     if (mode.HasValue)
         ScreenRotation = mode.Value;
     if (frequency.HasValue)
         ScreenFrequency = frequency.Value;
     if (color.HasValue)
         ScreenColor = color.Value;
 }
示例#8
0
 /// <summary>
 /// Create a display screen object with the given settings.
 /// If a setting is not given it will be used the current setting
 /// </summary>
 /// <param name="width">Screen width</param>
 /// <param name="height">Screen height</param>
 /// <param name="mode">Screen rotation mode</param>
 public DisplayScreen(int width, int height, RotateDesktopMode mode)
     : this()
 {
     Initialize(width, height, null, null, mode);
 }
示例#9
0
 /// <summary>
 /// Create a display screen object with the given settings.
 /// If a setting is not given it will be used the current setting
 /// </summary>
 /// <param name="width">Screen width</param>
 /// <param name="height">Screen height</param>
 /// <param name="frequency">Screen frequency</param>
 /// <param name="color">Screen color mode</param>
 /// <param name="mode">Screen rotation mode</param>
 public DisplayScreen(int width, int height, int frequency, short color, RotateDesktopMode mode)
     : this()
 {
     Initialize(width, height, frequency, color, mode);
 }
示例#10
0
 public static ChangeSettingsResult ChangeResolutionPermanently(RotateDesktopMode rotMode)
 {
     DisplayScreen screen = new DisplayScreen();
     screen.ScreenRotation = rotMode;
     return screen.UpdateSettingsInRegistry();
 }
示例#11
0
 public static ChangeSettingsResult ChangeResolutionTemporary(int width, int height, RotateDesktopMode rotMode)
 {
     DisplayScreen screen = new DisplayScreen();
     screen.ScreenWidth = width;
     screen.ScreenHeight = height;
     screen.ScreenRotation = rotMode;
     return screen.UpdateSettingsToFullscreen();
 }