Why are the Tkinter canvas lines jagged?

前端 未结 3 981
我寻月下人不归
我寻月下人不归 2021-01-05 00:31

The lines drawn on a Tkinter.Canvas are not smooth. How can they be made smooth?

Here\'s what I tried:

 from Tkinter import *
 root = Tk         


        
相关标签:
3条回答
  • 2021-01-05 00:58

    tkinter graphics are not anti-aliased which is why the diagonal line appears jagged. There may be a platform specific work-around like this one I found titled Drawing Anti-Aliased Graphics Under Tkinter/Windows to provide the functionality you desire.

    0 讨论(0)
  • 2021-01-05 01:01

    You might try to do some antialiasing of the poor, by drawing a clearer colored one pixel larger second line before (under) the first one.

    0 讨论(0)
  • 2021-01-05 01:05
    1. draw an antialias image (using Image PIL ,numpy,opencv etc)
    2. show the image on the canvas.
    0 讨论(0)
提交回复
热议问题