public void TestResolutionChange() { DisplayScreen screen = new DisplayScreen(); if (screen.ScreenWidth == 800) { screen.ScreenWidth = 1024; screen.ScreenHeight = 768; screen.UpdateSettingsToFullscreen(); DisplayScreen tmp = new DisplayScreen(); Assert.IsTrue((tmp.ScreenWidth == screen.ScreenWidth) && (tmp.ScreenHeight == screen.ScreenHeight)); DisplayScreen.ResetSettings(); } else { screen.ScreenWidth = 800; screen.ScreenHeight = 600; screen.UpdateSettingsToFullscreen(); DisplayScreen tmp = new DisplayScreen(); Assert.IsTrue((tmp.ScreenWidth == screen.ScreenWidth) && (tmp.ScreenHeight == screen.ScreenHeight)); DisplayScreen.ResetSettings(); } }
public static ChangeSettingsResult ChangeResolutionPermanently(RotateDesktopMode rotMode) { DisplayScreen screen = new DisplayScreen(); screen.ScreenRotation = rotMode; return(screen.UpdateSettingsInRegistry()); }
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(); }
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()); }
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()); }
/// <summary> /// Equals /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (obj == null) { return(false); } else if (!(obj is DisplayScreen)) { return(false); } else if (Object.ReferenceEquals(this, obj)) { return(true); } DisplayScreen res = obj as DisplayScreen; return (_devMode.dmPelsWidth.Equals(res._devMode.dmPelsWidth) && _devMode.dmPelsHeight.Equals(res._devMode.dmPelsHeight) && _devMode.dmDisplayFrequency.Equals(res._devMode.dmDisplayFrequency)); }
public static void ResetResolution() { DisplayScreen.ResetSettings(); }
static DesktopTools() { DisplayScreen.Init(); }
static DisplayScreen() { oldSettings = new DisplayScreen(); }
public static ChangeSettingsResult ChangeResolutionPermanently(RotateDesktopMode rotMode) { DisplayScreen screen = new DisplayScreen(); screen.ScreenRotation = rotMode; return screen.UpdateSettingsInRegistry(); }
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(); }