ImageGrab

gslm slm_guzel at hotmail.com
Tue Apr 3 16:46:29 EDT 2007


root = tk.Tk()
def click():
    x=button1.winfo_rootx()
    y=button1.winfo_rooty()
    image=PIL.ImageGrab.grab((x,y,x+260,y+250))
    image.save( 'tmp.jpeg')
    button1 = tk.Button(root, compound=tk.TOP,
    width=60, height=50,bg='black', 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...




More information about the Python-list mailing list