471,330 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

image transparency using Tkinter

3
hi to all...
i'm working on an animation where i have to make the picture background.gif transparent.
l'm not able to do it.can you please help me or tell me what codes i should add to make the picture transparent.
thank in advance


Expand|Select|Wrap|Line Numbers
  1. import Tkinter
  2. from Tkconstants import *
  3. def window(tk):
  4.  
  5.     global photo       
  6.  
  7.     frame=Tkinter.Frame(tk)
  8.  
  9.     frame.pack()
  10.  
  11.  
  12.  
  13.     canvas=Tkinter.Canvas(frame,bg ='white', width=500,height=500)
  14.  
  15.     canvas.pack()
  16.  
  17.  
  18.  
  19.     photo=Tkinter.PhotoImage(file="background.gif")
  20.     canvas.create_image(200, 250, image=photo)
  21.  
  22.  
  23.  
  24.  
  25. root = Tkinter.Tk()
  26.  
  27. root.title("Simulation of infectious diseases")
  28.  
  29. window(root)
  30.  
  31. root.mainloop()
Nov 6 '07 #1
1 10486
bartonc
6,596 Expert 4TB
So far, so good. Now, in order to work with images, you'll want to learn about the Python Image Library. You can get PIL at PythonWare.

Have fun.
Nov 6 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Stephen M. Gava | last post: by
1 post views Thread by Ankit | last post: by
11 posts views Thread by Kenneth McDonald | last post: by
reply views Thread by Guilherme Polo | last post: by
1 post views Thread by viv1tyagi | last post: by
3 posts views Thread by J-Burns | last post: by
2 posts views Thread by mcfly | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.