472,103 Members | 1,073 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,103 software developers and data experts.

How to Change Display Screen Resolution? (800x600)

How to Change Screen Resolution ?
Jun 10 '07 #1
9 24546
bartonc
6,596 Expert 4TB
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.
Jun 10 '07 #2
Win/Mac/Linux Change Display Screen Resolution Settings = 800x600
Jun 10 '07 #3
epots9
1,351 Expert 1GB
to change the resolution of your desktop click:
Start->Control Panel->Display->Settings (tab)

then change the resolution there
Jun 10 '07 #4
bartonc
6,596 Expert 4TB
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.
Jun 10 '07 #5
I am sorry..i couldn't explain.
My English is not good..
How to change the desktop resolution via python?
Ex:
Expand|Select|Wrap|Line Numbers
  1. import os
  2. sistem=os.name
  3. if sistem=="nt"
  4.     #Change screen resolution for windows
  5.       ChangeResolution = 800x600
  6. elif sistem=="posix":
  7.     #Change screen resolution for unix-linux
  8.       ChangeResolution = 800x600
  9. ....
  10. ....
  11. else:
  12.     #Change screen resolution for mac 
  13.       ChangeResolution = 800x600
  14.  
vs..
Thanks..
Jun 10 '07 #6
bartonc
6,596 Expert 4TB
I am sorry..i couldn't explain.
My English is not good..
How to change the desktop resolution via python?
Ex:
Expand|Select|Wrap|Line Numbers
  1. import os
  2. sistem=os.name
  3. if sistem=="nt"
  4.     #Change screen resolution for windows
  5.       ChangeResolution = 800x600
  6. elif sistem=="posix":
  7.     #Change screen resolution for unix-linux
  8.       ChangeResolution = 800x600
  9. ....
  10. ....
  11. else:
  12.     #Change screen resolution for mac 
  13.       ChangeResolution = 800x600
  14.  
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:
Expand|Select|Wrap|Line Numbers
  1. os.system("chscrres 800 600")
Although, I don't think is't a good idea for a program to change the screen resolution.
Jun 10 '07 #7
:(
ok.
Google>> http://mail.python.org/pipermail/tut...er/051106.html
Ex:
Expand|Select|Wrap|Line Numbers
  1. import os, sys
  2.  
  3. import win32api
  4. import win32con
  5. import pywintypes
  6.  
  7. display_modes = {}
  8. n = 0
  9. while True:
  10.   try:
  11.     devmode = win32api.EnumDisplaySettings (None, n)
  12.   except pywintypes.error:
  13.     break
  14.   else:
  15.     key = (
  16.       devmode.BitsPerPel, 
  17.       devmode.PelsWidth, 
  18.       devmode.PelsHeight, 
  19.       devmode.DisplayFrequency
  20.     )
  21.     display_modes[key] = devmode
  22.     n += 1
  23.  
  24. mode_required = (32, 1600, 1280, 70)
  25. devmode = display_modes[mode_required]
  26. win32api.ChangeDisplaySettings (devmode, 0)
  27.  
  28. #
  29. # ... time passes
  30. #
  31.  
  32. mode_required = (32, 1280, 1024, 70)
  33. devmode = display_modes[mode_required]
  34. win32api.ChangeDisplaySettings (devmode, 0)
  35.  
Error:
"exceptions.keyError:(32, 1600, 1280, 70)"
Jun 11 '07 #8
bartonc
6,596 Expert 4TB
:(
ok.
Google>> http://mail.python.org/pipermail/tut...er/051106.html
Ex:
Expand|Select|Wrap|Line Numbers
  1. import os, sys
  2.  
  3. import win32api
  4. import win32con
  5. import pywintypes
  6.  
  7. display_modes = {}
  8. n = 0
  9. while True:
  10.   try:
  11.     devmode = win32api.EnumDisplaySettings (None, n)
  12.   except pywintypes.error:
  13.     break
  14.   else:
  15.     key = (
  16.       devmode.BitsPerPel, 
  17.       devmode.PelsWidth, 
  18.       devmode.PelsHeight, 
  19.       devmode.DisplayFrequency
  20.     )
  21.     display_modes[key] = devmode
  22.     n += 1
  23.  
  24. mode_required = (32, 1600, 1280, 70)
  25. devmode = display_modes[mode_required]
  26. win32api.ChangeDisplaySettings (devmode, 0)
  27.  
  28. #
  29. # ... time passes
  30. #
  31.  
  32. mode_required = (32, 1280, 1024, 70)
  33. devmode = display_modes[mode_required]
  34. win32api.ChangeDisplaySettings (devmode, 0)
  35.  
Error:
"exceptions.keyError:(32, 1600, 1280, 70)"
Expand|Select|Wrap|Line Numbers
  1. n = 0
  2. while True:
  3.   try:
  4.     devmode = win32api.EnumDisplaySettings (None, n)
  5.   except pywintypes.error:
  6.     break
  7.   else:
  8.     key = (
  9.       devmode.BitsPerPel, 
  10.       devmode.PelsWidth, 
  11.       devmode.PelsHeight, 
  12.       devmode.DisplayFrequency
  13.     )
  14.     display_modes[key] = devmode
  15.     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:
Expand|Select|Wrap|Line Numbers
  1. for item in display_modes.items():
  2.     print item
Jun 11 '07 #9
Motoma
3,237 Expert 2GB
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)
Jun 12 '07 #10

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Bertrand1978 | last post: by
6 posts views Thread by Darian | last post: by
4 posts views Thread by Bill Nguyen | last post: by
5 posts views Thread by Maxi | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.