Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. class BackgroundBoard(tk.Frame):
  2.  
  3.     def __init__(self, master=None):
  4.         tk.Frame.__init__(self)
  5.         self.master.title("Chess Python")
  6.         self.background_image = Image.open(os.path.join(
  7.             os.path.dirname(__file__)) + "/img/board.png")
  8.         self.background_photo = ImageTk.PhotoImage(
  9.             self.background_image)
  10.         (backgroundWidth, backgroundHeight) = self.background_image.size
  11.         self.canvas = tk.Canvas(self, width=backgroundWidth,
  12.                                 height=backgroundHeight)
  13.         self.canvas.pack(side="top", fill="both", expand=True)
  14.         self.canvas.create_image(0, 0, image=self.background_photo,
  15.                                  anchor="nw")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement