I have trawled the net and can't seem to find a satisfactory answer. Whenever I run a program that has a Tkinter GUI it always seems blurry/fuzzy (which I assume is a low resolution). It seems much lower resolution than the Windows 10 OS that is running on a couple of computers that I run these programs on.
It doesn't matter what program I run I still get the same results for all types of Tkinter entities such as buttons, labels, file dialogues etc. Which is why I have not included a sample of code.
I have copied some examples below:
Tkinter FD
Tkinter Label
Is this something I should just expect or is there some of setting on the OS\Python\Tkinter that I need to alter.
Any help would be very much appreciated.
It seems to be an OS tweak. I don't know the details (would be glad for an explanataion), but it does the job on Windows 10:
ctypes.windll.shcore.SetProcessDpiAwareness(1)
Call it before you initiate your GUI, i.e.:
import ctypes
.
.
.
if __name__ == "__main__":
if 'win' in sys.platform:
ctypes.windll.shcore.SetProcessDpiAwareness(1)
[call your Tkinter stuff]
Got it from here:
Attempting to resolve blurred tkinter text + scaling on Windows 10 high DPI displays, but concerned my approach is not Pythonic or is unsafe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With