[ TAG 413 ][08.05.2022] -Erfolgreich -Desktop-Dimensionen mit Tkinter ermitteln
Tkinter
import Tkinter
root = Tkinter.Tk()
width = root.winfo_screenwidth()
height = root.winfo_screenheight()
Weitere Möglichkeiten habe ich in der [stackoverflow]-Comunity gefunden.
import ctypes
user32 = ctypes.windll.user32
screensize = user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)
For multi-monitor setups, you can retrieve the combined width and height of the virtual monitor:
import ctypes
user32 = ctypes.windll.user32
screensize = user32.GetSystemMetrics(78), user32.GetSystemMetrics(79)
Quellen
- [Getting Your Screen Resolution with Python]
- [https://www.blog.pythonlibrary.org/2015/08/18/getting-your-screen-resolution-with-python/]
- [Getting screen’s height and width using Tkinter | Python]
- [https://www.geeksforgeeks.org/getting-screens-height-and-width-using-tkinter-python/]
- [How do I get monitor resolution in Python?]
- [https://stackoverflow.com/questions/3129322/how-do-i-get-monitor-resolution-in-python]
- [https://msdn.microsoft.com/en-us/library/windows/desktop/ms724385(v=vs.85).aspx]
Kommentare
Kommentar veröffentlichen