in the following code I am trying to put two images on two separate window frames using Canvas
PANEL_HEIGHT = 440
PANEL_WIDTH = 304
BKG_IMG = "./backgrounds/Wireframe- welcome screen – 1.png"
MANAGE_ACC_BKG_IMG = "./backgrounds/Wireframe- welcome screen – 1.png"
class window1:
def __init__(self):
self.panel = Tk()
self.panel.geometry(f"{PANEL_WIDTH}x{PANEL_HEIGHT}")
self.canvas = Canvas(self.panel,width=2*PANEL_WIDTH, height=2*PANEL_HEIGHT)
canvas = self.canvas
img = PhotoImage(file=BKG_IMG)
canvas.create_image(PANEL_WIDTH,PANEL_HEIGHT,image=img)
canvas.place(x=-(PANEL_WIDTH/2),y=-(PANEL_HEIGHT/2))
class window2:
def __init__(self):
self.panel = Tk()
self.panel.geometry(f"{PANEL_WIDTH}x{PANEL_HEIGHT}")
self.canvas = Canvas(self.panel, width=2 * PANEL_WIDTH, height=2 * PANEL_HEIGHT)
canvas = self.canvas
img = PhotoImage(file=MANAGE_ACC_BKG_IMG)
canvas.create_image(PANEL_WIDTH, PANEL_HEIGHT, image=img)
canvas.place(x=-(PANEL_WIDTH / 2), y=-(PANEL_HEIGHT / 2))
window1()
window2()
on calling these two classes I am getting "image 'pyimage2' doesn't exist" error
Absolute path of both the files are
D:\pyAut\pythonBootCamp\backgrounds\manage_acc_ui_bkg.png D:\pyAut\pythonBootCamp\main.py
could any body tell how to accomplish the task????