Python Tkinter Canvas Oval principle

Source: Internet
Author: User

Ovals, mathematically, is ellipses, including circles as a special case. The ellipse is fit to 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 would coincide with the top and left-hand lines of this box, but would fit just inside the bottom and right-hand si Des.

To create a 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= "" would Select this behavior. You can also set this option to any color and the interior of the ellipse would be a 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 would be stippled. Default is stipple= "", which means a solid color. A typical value would be stipple= "gray25". has no effect unless the fill have been set to some color. See section 4.7, "Bitmaps".

Tags

The tags to is associated with the object, as a sequence of strings. See section 6.1.4, "Canvas tags".

Width

The Width of the border around the outside of the ellipse. Default is 1 pixel; See sections 4.1, "Dimensions" for possible values. If you set this to zero, the border is not appear. If you set this to zero and make the fill transparent, you can make the entire oval disappear.

In fact, it is just that the main principle of the ellipse is known, according to the two-point rectangle, and then draw a unique inner-tangent ellipse. That is to achieve a two point to determine an ellipse.

Python Tkinter Canvas Oval principle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.