Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_png_zlib_base64.py
- py_png_b64='''\
- eJxtV8nOszASPOd7FQ4hbCFHs5vdLAFyYwt7gJDEwNMP/2iOY8kSIBnb1VXV3SeP7FVH6msEBADc
- HPxvuBYGsY1B6gCQIAwyhEBxzCzAoPQxiEJkDagCrY/ll4+Tb4DH8e/kV9XHB/jtA9DfAagiBIYI
- gPlege8dg2+M8m8E8CVACxvXHekjsCQYrA8ALgkCZAYAd8xzseHz3ykEK8iqVS1rVki8Vcs8zygE
- z342LIxF1klFHRWiHT73IkjbHiXtJUwDPSqkR1WSQpyGj0cqX4q009O/Uy4Lz6fc1znZN2XYD8/w
- 1pfooVeCd28FNmu3qax3O653JauCPq+bR9u3dVfv3tQ362fcbTzuymXeJ+bvNJNCWcveUMt235DF
- UoePX9t9tr674E6+UV3/+VV3ATf36VJd+q2595emv7HtRaD7y53u+prrB4Fqos/179SHkfQNU/iT
- Z3HpBvXbc+LYU8p8983P3bF/99n69IS9RCl8DQPo1U19aY7aa6o2xKrxes16Rw/WQH+9428xhV6U
- r07DDMeIcCdqc95q6X1j1RxfpTNqqTvSfjDRpf+ON298RY9vTFW/wYlwRKWYGsrt5TzxS63/Tlv8
- rTG99RvdzDu9TTvt96QmTpfpQ2gpJ0ucD2Ruk9S59JSrIwvZHIjvJlDe3FM2Nt1MHckyokifI//v
- ZF2jAF7TyOaoRn/PvfEuO0dvHI/9eoHhB96cxveUyu7X4eFdh+JuDOWDo4qUo8r8Kj6L67f13uIQ
- v9XP3ym6bmM0c206b02eRVV6daYsm4/pv8ts+JaWGou8nyq5/9BzJ7fzuVU//qjl1KTz29vJ1Yt7
- a75GoR4xNQuRdT8Ddu2ZtWzq5ubft5/Pn+ij8v7ti/2bysc36hIvwy/Lqa24ibfcPoPQ1sCz1Ayv
- dK3wK0mJE7h/p4cjKfk3cwvHhM/RcAeoPmZmzt9QTZekLJbEqRambH5s+f2NfothOq2MMe6J/94h
- h/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s1jCsO4MB4ailmhudcM+hx7jQketGTD3JHtgtezRt3EJJ+j
- r/9w0O91oLBz8ZXUJMFne3DjzMki1Yz6oFHTnFn9CXbx5FYmrjb7ADC5fTLVaO2y5EaN7J8/2Qwu
- 3qFTIv3GhD+E+9PubMJN8F6p1/houAn2WtWtd76Sb9F4ujnFTA5/NXkrxE9TI3n4OUOzc+dWToPn
- rVaEmP87XV+3M4pN93y+0k8yF476+Pofbeh1KA=='''
- #
- from Tkinter import Tk, Canvas
- from cStringIO import StringIO
- from PIL import ImageTk, Image
- import base64, zlib
- root = Tk()
- z = base64.decodestring(py_png_b64)
- z = zlib.decompress(z)
- z = StringIO(base64.decodestring(z))
- z = Image.open(z)
- tkimg = ImageTk.PhotoImage(z)
- canvas = Canvas(root, height=200, width=200)
- canvas.grid()
- canvas.create_image(100, 100, image=tkimg)
- def stamp(event):
- canvas.create_image(event.x, event.y, image=tkimg)
- canvas.bind('<ButtonPress-1>', stamp)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement