![tkinter image resize tkinter image resize](https://i.stack.imgur.com/TKi0I.png)
In this code, we have created multiple objects & we have created buttons to delete these objects. And these objects will be deleted when the delete method is used for the provided tag.The same tag name can be provided to multiple objects.
#Tkinter image resize code#
this code will delete only the rectangle having a tag as rect.tags can be created by using the keyword tag followed by any name.To delete a specific object of the canvas, provide the tag name in place of “all”.all is a built-in feature that is used to delete everything inside the canvas.
![tkinter image resize tkinter image resize](https://i.stack.imgur.com/HEqRk.png)
![tkinter image resize tkinter image resize](https://image.space.rakuten.co.jp/d/strg/ctrl/9/0b792c109189e8eae8f0021373829128f1bd863b.16.2.9.2.jpeg)
Python tkinter rectangle using canvas Python Tkinter Canvas Image In this output, rectangle is created using python tkinter Canvas. Here is the code with explanation to create python tkinter rectangle using canvas. Here x1 and y1 are the coordinates for the top left corner and x2 and y2 are the coordinates for the bottom right corner. This method accepts 4 parameters x1, y1, x2, y2.To create a rectangle create_rectangle() method is used.Python Tkinter Canvas has built-in features to create shapes.If you are new to Python Tkinter or Python GUI programming, check out Python GUI Programming (Python Tkinter) and Python Tkinter drag and drop. The layer of python Tkinter canvas is decided on the basis of the sequence of placement, which means the object placed in end stys on the top layer.Moving to the right increases x value and Moving to the left increases y value.In canvas, x & y coordinates have 0 value at the top left corner.Using canvas 2D objects can be created like text, circle, rectangle, etc.Canvas is a drawing widget and it can hold other widgets as well.Like other widgets, the canvas is also a widget that is used for multiple uses.Python Tkinter Canvas Size Python Tkinter Canvas Tutorial