关于多边形 [英] about polygon

查看:90
本文介绍了关于多边形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我在下面的代码中有一个黑色多边形?

如何让它填充无色?

谢谢!


import Tkinter


c = Tkinter.Canvas(宽度= 220,身高= 220)

c.pack()

c.create_polygon(60,60,100,60,100,100,60,120)

c.mainloop()

解决方案

嗨!


Am Sun,2005年11月20日03:55:21 -0800 schrieb施穆:

为什么我在下面有一个黑色多边形代码?
如何让它填充无颜色?




请改用create_line:

c.create_line(60, 60,100,60,100,100,60,120,60,60)

Jan


施木写道:

为什么我在下面的代码中有一个黑色多边形?
如何让它填充无色?
谢谢!

导入Tkinter

c = Tkinter.Canvas(width = 220,height = 220)
c.pack()
c.create_polygon(60,60,100,60,100,100,60,120)
c.mainloop()




您可以明确设置颜色(使用"表示透明度):


c.create_polygon(60,60,100,60,100,100,60,120,fill ="",outline =" black")

>
我不知道为什么这不是默认的。


彼得


< blockquote>嗨!


Am Sun,2005年11月20日03:55:21 -0800 schrieb施穆:

为什么我有黑以下代码中的多边形?
如何使其填充无颜色?




请改用create_line:

c。 create_line(60,60,100,60,100,100,60,120,60,60)

Jan


Why I got a black polygon in the following code?
How can I make it no-color filled?
Thanks!

import Tkinter

c = Tkinter.Canvas(width=220, height=220)
c.pack()
c.create_polygon(60,60,100,60,100,100,60,120)
c.mainloop()

解决方案

Hi!

Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu:

Why I got a black polygon in the following code?
How can I make it no-color filled?



Use create_line instead:
c.create_line(60,60,100,60,100,100,60,120,60,60)

Jan


Shi Mu wrote:

Why I got a black polygon in the following code?
How can I make it no-color filled?
Thanks!

import Tkinter

c = Tkinter.Canvas(width=220, height=220)
c.pack()
c.create_polygon(60,60,100,60,100,100,60,120)
c.mainloop()



You can set the color explicitly (use "" to denote transparency):

c.create_polygon(60,60,100,60,100,100,60,120, fill="", outline="black")

I don''t know why that isn''t the default.

Peter


Hi!

Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu:

Why I got a black polygon in the following code?
How can I make it no-color filled?



Use create_line instead:
c.create_line(60,60,100,60,100,100,60,120,60,60)

Jan


这篇关于关于多边形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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