为什么 Windows 上的 Tkinter 渲染质量更差? [英] Why is the Tkinter render quality much worse on windows?

查看:26
本文介绍了为什么 Windows 上的 Tkinter 渲染质量更差?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Mac 上用 Tkinter 开发了一个 python 应用程序.它涉及表格和画布绘图.在 Mac 上,它看起来很棒.然而,在我的戴尔笔记本电脑(4K 显示器,比我的 Mac 更强大)上,Tkinter ui 看起来非常像素化,并且某些元素的位置略有不同.这个问题是什么,我该怎么做才能在戴尔 Windows 10 或其他平台上更好地呈现 Tkinter?这是 UI 相同部分的屏幕截图(显示表单和画布绘图)...

I have developed a python app with Tkinter on a Mac. It involves forms, and canvas drawings. On the Mac, it looks great. However on my Dell laptop (4K display, and more powerful than my Mac), the Tkinter ui appears very pixelated and certain elements are located slightly differently. What is this problem known as and what can I do to render Tkinter better on Dell Windows 10 or other platforms in general? Here is a screen shot of the same part of the UI (showing form and canvas drawing)...

Windows(坏)

Mac(普通)

推荐答案

抗锯齿仅对 OSX 中的 Tkinter 画布对象启用.你可以得到 aggDraw 库:http://effbot.org/zone/tkinter-aggdraw.htm 作为一种解决方法,但否则在尝试在画布上绘制时会出现锯齿状线条.但是,所有主要平台上的字体都应消除锯齿.

Antialiasing is only enabled for Tkinter canvas object in OSX . You can get the aggDraw lib: http://effbot.org/zone/tkinter-aggdraw.htm as a workaround, but otherwise you will get jagged lines when trying to draw on a canvas. Fonts however should be anti-aliased on all major platforms.

这篇关于为什么 Windows 上的 Tkinter 渲染质量更差?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆