Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Image set into frame

i want set image into frame in canvas. My idea is to be able to click and take action on the frame.

I know set image and separate frame. But i don't know how to link it.

import tkinter

canvas = tkinter.Canvas()
canvas.pack()

x1, y1, x2, y2 = 50, 50, 150, 150

Img = tkinter.PhotoImage(file = 'vtak0.png')

canvas.create_image(100,  100, image = Img)
canvas.create_rectangle(x1, y1, x2, y2) 

Comments