Need to switch the screen resolution frequently, want to write a script to achieve, need to switch to run a bit good
On the Internet, you need to use Windows Api,changedisplaysettings
The implementation code is as follows
Import== 720=0win32api = = = = . ChangeDisplaySettings (DM, 0)
Which, at first did not set the value of the Displayfixedoutput, the effect on my machine is, cut to a small resolution, the screen only in the middle of a small piece, and in the system adjustment, it can be stretched, and later found that this value is in effect
The explanation on MSDN is
Value |
meaning |
|
Dmdfo_default |
The display ' s default setting. |
#define DMDFO_DEFAULT 0 |
Dmdfo_center |
The low-resolution image is centered in the larger screen space. |
#define Dmdfo_center 2 |
Dmdfo_stretch |
The low-resolution image is stretched to fill the larger screen space. |
#define DMDFO_STRETCH 1 |
Set the value to 1, or 0, to stretch on my machine
With this script, you need to change the resolution, just double-click
Python tune Win32API Adjust screen resolution