473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

about polygon

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()
Nov 22 '05 #1
10 2902
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
Nov 22 '05 #2
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

Nov 22 '05 #3
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
Nov 22 '05 #4
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

Nov 22 '05 #5
On 11/20/05, Jan Voges <ja*****@gmx.net> wrote:
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

If so, what is the difference between create_line and create_polygon?
Thanks!
Nov 22 '05 #6
On 11/20/05, Jan Voges <ja*****@gmx.net> wrote:
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

If so, what is the difference between create_line and create_polygon?
Thanks!
Nov 22 '05 #7
Shi Mu wrote:
On 11/20/05, Jan Voges <ja*****@gmx.net> wrote:
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,6 0)

Jan


If so, what is the difference between create_line and create_polygon?


Well, that one is filled and the other not?

Diez
Nov 22 '05 #8
Shi Mu wrote:
On 11/20/05, Jan Voges <ja*****@gmx.net> wrote:
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,6 0)

Jan


If so, what is the difference between create_line and create_polygon?


Well, that one is filled and the other not?

Diez
Nov 22 '05 #9
Hi

Am Sun, 20 Nov 2005 04:45:52 -0800 schrieb Shi Mu:
If so, what is the difference between create_line and create_polygon?


create_polygon only creates closed polygons.

Jan
Nov 22 '05 #10
Hi

Am Sun, 20 Nov 2005 04:45:52 -0800 schrieb Shi Mu:
If so, what is the difference between create_line and create_polygon?


create_polygon only creates closed polygons.

Jan
Nov 22 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
BSOB
by: BSOB | last post by:
im gone for a long weekend so plenty of time for anyone to answer. if i have 4 points representing a polygon and each point is represented by an x and a y coordinate, is there an easy (or slightly...
6
by: foonicate | last post by:
I apologize if I posted this to the wrong group. I am working with C code that (atm) draws a 2d polygon with an exclusion polygon in the center. There are points located throughout the polygon...
1
by: jojojjose | last post by:
function draw() { var s=''; s+='<v:polygon points="'; s+= //points from server s+="> </v:polygon>'"; document.wrie(s); }
8
by: tharringtonan | last post by:
I am compiling the following code, main.cpp, as follows: gcc main.cpp I get the following compile error: main.cpp: In function `int main()': main.cpp:28: no matching function for call to...
3
by: jojo41300000 | last post by:
Hi, Is anyone know that how to get the x and y points inside the polygon using C++ program? I have the given polygon data to draw the polygon, but i don't know how to get all the points...
10
by: colin | last post by:
Hi, I profile my code and find its spending a lot of time doing implicit conversions from similar structures. the conversions are mainly things like this class Point { implicit conversion...
3
by: friendkitty | last post by:
Hi All, I m a new member here.I am now writing a program that render Vertex Normals.I m now trying to implement a data structure that will best suit computing vertex normals.For that computation ,...
0
by: =?Utf-8?B?U2ViYXN0aWFuIEZyw6Ruaw==?= | last post by:
In several locations in the MSDN Mappoint Web Service SDK it says: "Creating Polygons There are several ways you can create and prepare polygon data for upload to the Customer Service Site: 1....
2
by: Swan666 | last post by:
I have a function which creates a polygon of blue color. I call this function inside a loop of 128 iterations. For every iteration, i change the value of x and y so that my polygon is rendered on new...
8
by: jpatchak | last post by:
Hello, I am having a problem using intersects method of a class I made that extends Polygon. Basically, I am trying to write code that allows the user to drag these polygons. I create a 1x1...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.