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原理的更多相关文章

  1. (转)]PYTHON Tkinter GUI

    import Tkinterroot=Tkinter.Tk()label=Tkinter.Label(root,text='hello ,python')label.pack()      #将LAB ...

  2. tkinter Canvas画图片大坑总结

    一.ImportError: cannot import name '_imagingtk' 问题描述 使用tkinter画pillow生成的图片时,在tkinter中抛出此异常. 解决方案 pip ...

  3. python Tkinter图形用户编程简单学习(一)

    Events(事件) Events are given as strings, using a special event syntax:事件以字符串的方式给出,使用特殊的事件语法:<modif ...

  4. python写红包的原理流程包含random,lambda其中的使用和见简单介绍

    Python写红包的原理流程 首先来说说要用到的知识点,第一个要说的是扩展包random,random模块一般用来生成一个随机数 今天要用到ramdom中unifrom的方法用于生成一个指定范围的随机 ...

  5. Python程序的执行原理(转载)

    Python程序的执行原理 2013-09-17 10:35 佚名 tech.uc  1. 过程概述 Python先把代码(.py文件)编译成字节码,交给字节码虚拟机,然后虚拟机一条一条执行字节码指令 ...

  6. python模块之HTMLParser(原理很大程度上就是对类构造的熟练运用)

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python模块之HTMLParser(原理很大程度上就是对类构造的熟练运用) import HTMLPar ...

  7. Python Tkinter基础控件入门实例

    分享一个Python Tkinter基础控件用法的入门例子,包括窗口的显示.显示内置图片.弹出窗口.菜单等. 例子,Python Tkinter基础控件的用法 # -*- coding: utf-8 ...

  8. Python Tkinter 学习成果:点歌软件music

    笔者工作业余时间也没什么爱好,社交圈子也小,主要娱乐就是背着自己带电瓶的卖唱音响到住地附近找个人多的位置唱唱KtV. 硬件上点歌就用笔记本电脑,歌曲都是网上下载的mkv格式的含有两个音轨的视频.因此点 ...

  9. Python Tkinter Entry(文本框)

    Python学习记录--关于Tkinter Entry(文本框)的选项.方法说明,以及一些示例. 属性(Options) background(bg) borderwidth(bd) cursor e ...

随机推荐

  1. (a*b)%c 问题

    给你两个数__int64 类型的整数 a ,b,c.问你,(a*b)%c的值是多少??我们知道: (a*b)%c = ((a%c)*(b%c))%c .不过即使这样做,在c很大的情况下,(a%c)*( ...

  2. Mysql常用命令和常用函数

    函数 : FROM_UNIXTIME(unix_timestamp,format)  时间戳转字符串日期格式 格式化规则如下 %M 月名字(January……December) %W 星期名字(Sun ...

  3. MVC再次学习1

    1.0 匿名函数和匿名类: internal delegate int AddDel(int a, int b); //泛型委托 delegate T Demo<T>(int a,int ...

  4. 2015年阿里巴巴蚂蚁金服校招JAVA研发工程师内推电话面试

    没想到阿里校招如此之早,虽然早已进入复习备战状态,但还是感觉有些措手不及...找了个在蚂蚁金服做HR的同学帮忙了内推,然后在最近的几天匆匆忙忙地复习JAVA(之前都把精力放在了数据结构.算法等基础上了 ...

  5. STL之二分查找 (Binary search in STL)

    STL之二分查找 (Binary search in STL) Section I正确区分不同的查找算法count,find,binary_search,lower_bound,upper_bound ...

  6. Sticks(Central Europe 1995) (DFS)

    Sticks(Central Europe 1995) Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d &am ...

  7. C++中利用libxl操作Excel表格

    libxl是一款操作excel的商业库,支持C.C++.C#和Delphi.下文利用libxl在C++中实现了从excel文档的表1中随机挑选记录,保存到新建的表中.以下为代码: #include & ...

  8. Bitmap 与ImageSource之间的转换

    public class ImageConverter { [DllImport("gdi32.dll", SetLastError = true)] private static ...

  9. vmware 网络连接

    解决VMware nat service等服务不能启动 虚拟机如何设置网络连接来上网?

  10. Linux系统启动过程介绍

    Linux系统启动过程介绍 学习操作系统有必要了解一下系统的启动过程,这样在面对各种系统故障的时候能快速定位解决问题,下面以Centos来分析linux系统的启动过程. 1.BIOS自检:当开机的时候 ...