ImageGrab

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gslm

    #1

    ImageGrab

    root = tk.Tk()
    def click():
    x=button1.winfo _rootx()
    y=button1.winfo _rooty()
    image=PIL.Image Grab.grab((x,y, x+260,y+250))
    image.save( 'tmp.jpeg')
    button1 = tk.Button(root, compound=tk.TOP ,
    width=60, height=50,bg='b lack', command=click)
    button1.pack()
    root.mainloop()

    Hi! How can I save only the button area and then open this image file
    and print this?

    If you help, I'll be very happy!
    Thanks and regards...

Working...