SHARE
TWEET

Untitled

a guest May 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from tkinter import *
  2. import tkinter as tk
  3. from tkinter import ttk
  4. from PIL import Image, ImageTk
  5.  
  6. class Aplikacja(tk.Frame):
  7.  
  8.     def __init__(self, master=None):
  9.         tk.Frame.__init__(self, master)
  10.         self.pack(ipadx=375, ipady=350)
  11.  
  12.         self.PrzyciskOdbierz = tk.Button(self, text='Otworz', font=('Helvetica', '14'),bg="orange")
  13.         self.PrzyciskOdbierz.place(x=10, y=160, width=160, height=50)
  14.  
  15. root = tk.Tk()
  16. root.title("Marciniak")
  17.  
  18. jpgfile = Image.open(r"C:\Users\Mateusz\Pictures\avatar.jpg")
  19. jpgfile = Image.open(open(r"C:\Users\Mateusz\Pictures\avatar.jpg", 'rb'))
  20. photo = ImageTk.PhotoImage(jpgfile)
  21.  
  22. jpgfile2 = Image.open(r"C:\Users\Mateusz\Pictures\avatar.jpg")
  23. jpgfile2 = Image.open(open(r"C:\Users\Mateusz\Pictures\logo.jpg", 'rb'))
  24. photo2 = ImageTk.PhotoImage(jpgfile2)
  25.  
  26. cv = tk.Canvas()
  27. cv.pack(side='top', fill='both', expand='yes')
  28. cv.create_image(10, 10, image=photo, anchor='nw')
  29. cv.create_image(100, 100, image=photo2, anchor='nw')
  30.  
  31. #root.minsize(680, 420)
  32. #root.maxsize(680, 420)
  33. #root.geometry("680x420")
  34.  
  35. app = Aplikacja(master=root)
  36.  
  37. app.mainloop()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top