首页 > 编程语言 > 详细

Python Tkinter canvas oval原理

时间:2016-05-09 00:02:29      阅读:334      评论:0      收藏:0      [点我收藏+]

Ovals, mathematically, are ellipses, including circles as a special case. The ellipse is fit into a rectangle defined by the coordinates (x0, y0) of the top left corner and the coordinates (x1, y1) of the bottom right corner:

 技术分享

The oval will coincide with the top and left-hand lines of this box, but will fit just inside the bottom and right-hand sides.

To create an ellipse on a canvas C, use:

    id = C.create_oval ( x0, y0, x1, y1, option, ... )

which returns the object ID of the new oval object on canvas C.

Options for ovals:

fill

The default appearance of ellipse is transparent, and a value of fill="" will select this behavior. You can also set this option to any color and the interior of the ellipse will be filled with that color; see Section 4.3, “Colors”.

outline

The color of the border around the outside of the ellipse. Default is outline="black".

stipple

A bitmap indicating how the interior of the ellipse will be stippled. Default is stipple="", which means a solid color. A typical value would be stipple="gray25". Has no effect unless the fill has been set to some color. See Section 4.7, “Bitmaps”.

tags

The tags to be associated with the object, as a sequence of strings. See Section 6.1.4, “Canvas tags”.

width

Width of the border around the outside of the ellipse. Default is 1 pixel; see Section 4.1, “Dimensions” for possible values. If you set this to zero, the border will not appear. If you set this to zero and make the fill transparent, you can make the entire oval disappear.

 

 

其实,是刚知道画椭圆的主要原理,根据两点确定的矩形,然后画一个唯一的内切的椭圆。也就是实现了两点确定一个椭圆。

Python Tkinter canvas oval原理

原文:http://www.cnblogs.com/spring87/p/5471986.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!