|
P: 4
|
How to Change Screen Resolution ?
| |
Share this Question
| Expert 5K+
P: 5,734
|
How to Change Screen Resolution ?
The maximum screen resolution depends on your hardware.
A program may be run in DOS mode. That may be what you are looking for.
Please tell us more about your system and what you are trying to do.
Thanks for joining.
| | |
P: 4
|
Win/Mac/Linux Change Display Screen Resolution Settings = 800x600
| | | Expert 100+
P: 1,113
|
to change the resolution of your desktop click:
Start->Control Panel->Display->Settings (tab)
then change the resolution there
| | | Expert 5K+
P: 5,734
|
Win/Mac/Linux Change Display Screen Resolution Settings = 800x600
This was moved from the Python forum because it looked like a window question.
I'll move it back if you are trying to control the screen resolution from python. But you must be clear about what you are trying to do and what you have done so far in this regard.
| | |
P: 4
|
I am sorry..i couldn't explain.
My English is not good..
How to change the desktop resolution via python?
Ex: -
import os
-
sistem=os.name
-
if sistem=="nt"
-
#Change screen resolution for windows
-
ChangeResolution = 800x600
-
elif sistem=="posix":
-
#Change screen resolution for unix-linux
-
ChangeResolution = 800x600
-
....
-
....
-
else:
-
#Change screen resolution for mac
-
ChangeResolution = 800x600
-
vs..
Thanks..
| | | Expert 5K+
P: 5,734
|
I am sorry..i couldn't explain.
My English is not good..
How to change the desktop resolution via python?
Ex: -
import os
-
sistem=os.name
-
if sistem=="nt"
-
#Change screen resolution for windows
-
ChangeResolution = 800x600
-
elif sistem=="posix":
-
#Change screen resolution for unix-linux
-
ChangeResolution = 800x600
-
....
-
....
-
else:
-
#Change screen resolution for mac
-
ChangeResolution = 800x600
-
vs..
Thanks..
On Windows:
Do a google search for "Programmatically change display resolution".
Get that package working from the command line.
Then Python will be able to: - os.system("chscrres 800 600")
Although, I don't think is't a good idea for a program to change the screen resolution.
| | |
P: 4
|
:(
ok.
Google>> http://mail.python.org/pipermail/tut...er/051106.html
Ex: -
import os, sys
-
-
import win32api
-
import win32con
-
import pywintypes
-
-
display_modes = {}
-
n = 0
-
while True:
-
try:
-
devmode = win32api.EnumDisplaySettings (None, n)
-
except pywintypes.error:
-
break
-
else:
-
key = (
-
devmode.BitsPerPel,
-
devmode.PelsWidth,
-
devmode.PelsHeight,
-
devmode.DisplayFrequency
-
)
-
display_modes[key] = devmode
-
n += 1
-
-
mode_required = (32, 1600, 1280, 70)
-
devmode = display_modes[mode_required]
-
win32api.ChangeDisplaySettings (devmode, 0)
-
-
#
-
# ... time passes
-
#
-
-
mode_required = (32, 1280, 1024, 70)
-
devmode = display_modes[mode_required]
-
win32api.ChangeDisplaySettings (devmode, 0)
-
Error:
"exceptions.keyError:(32, 1600, 1280, 70)"
| | | Expert 5K+
P: 5,734
|
:(
ok.
Google>> http://mail.python.org/pipermail/tut...er/051106.html
Ex: -
import os, sys
-
-
import win32api
-
import win32con
-
import pywintypes
-
-
display_modes = {}
-
n = 0
-
while True:
-
try:
-
devmode = win32api.EnumDisplaySettings (None, n)
-
except pywintypes.error:
-
break
-
else:
-
key = (
-
devmode.BitsPerPel,
-
devmode.PelsWidth,
-
devmode.PelsHeight,
-
devmode.DisplayFrequency
-
)
-
display_modes[key] = devmode
-
n += 1
-
-
mode_required = (32, 1600, 1280, 70)
-
devmode = display_modes[mode_required]
-
win32api.ChangeDisplaySettings (devmode, 0)
-
-
#
-
# ... time passes
-
#
-
-
mode_required = (32, 1280, 1024, 70)
-
devmode = display_modes[mode_required]
-
win32api.ChangeDisplaySettings (devmode, 0)
-
Error:
"exceptions.keyError:(32, 1600, 1280, 70)"
-
n = 0
-
while True:
-
try:
-
devmode = win32api.EnumDisplaySettings (None, n)
-
except pywintypes.error:
-
break
-
else:
-
key = (
-
devmode.BitsPerPel,
-
devmode.PelsWidth,
-
devmode.PelsHeight,
-
devmode.DisplayFrequency
-
)
-
display_modes[key] = devmode
-
n += 1
You now have a dictionary [display_modes], keyed on the
height, width and depth needed.
You'll want to print the dictionary to see what modes that your system is actually capable of: - for item in display_modes.items():
-
print item
| | | Expert 2.5K+
P: 2,649
|
How to Change Screen Resolution ?
It seems there is a small amount of ambiguity in what you are try to accomplish. Perhaps you could be more thorough in explaining what you want to do (not just change screen resolution, try insteas change screen resolution for a game, change default desktop resolution for....etc)
| | Post your reply Help answer this question
Didn't find the answer to your Python question?
You can also browse similar questions: Python | | Question stats - viewed: 8414
- replies: 9
- date asked: Jun 10 '07
|