- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change the thickness of a shape's outline on a Tkinter canvas?
Let us suppose we have created an oval on a Tkinter canvas. The task is to change the thickness of the oval's outline. To change the thickness of the outline, provide a border or outline to a rectangle, define the width property in the constructor and assign it an integer value. You can also define the outline property to set a color to the outline of the oval.
Example
#Import the required libraries from tkinter import * #Create an instance of Tkinter Frame win = Tk() #Set the geometry win.geometry("700x350") # Define a Canvas Widget canvas = Canvas(win, width=500, height=350) canvas.pack() # Create an oval in Canvas canvas.create_oval(100,300,500,100, outline='green', width=5) win.mainloop()
Output
Running the above code will display a window containing an oval with a thick green outline.
- Related Articles
- How to put an outline on a canvas text on Tkinter?
- Tkinter - How to put an outline on a canvas text
- How to colorize the outline of a Tkinter canvas rectangle?
- How to colorize the outline of a canvas rectangle in Tkinter?
- How to change the background color of a tkinter Canvas dynamically?
- How to create a Button on a Tkinter Canvas?
- How to draw a line on a Tkinter canvas?
- How to draw a dashed line on a Tkinter canvas?
- How to draw an arc on a tkinter canvas?
- How to draw a png image on a Python tkinter canvas?
- How to change the color of a Tkinter rectangle on clicking?
- How to change the TKinter canvas line from dash to solid?
- How do you create a Button on a Tkinter Canvas?
- How can I vary a shape's alpha with Tkinter?
- How do I update images on a Tkinter Canvas?

Advertisements