473,238 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 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 11105
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

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

Similar topics

0
by: Casey Hawthorne | last post by:
Is there a better way to delete the image from a Tkinter button other than the following: - reconstructing the button - image=blank.gif -- Regards,
10
by: Stephen M. Gava | last post by:
Hi all, I prefer using tkinter to wxpython (so sue me :) and i need to display a lot of html in a particular app. does anyone know if one of the existing add on tk html widgets have been wrapped...
1
by: Ankit | last post by:
Hi guys i need to make a table to store a certain data using Tkinter..I have searched on the group but i have not been able to find a solution that would work for me..The thing is that i want my...
1
by: alivip | last post by:
I integrat program to be GUI using Tkinter I try browser direction as you can see # a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, # ctrl+v to...
11
by: Kenneth McDonald | last post by:
Any guesses as to how many people are still using Tkinter? And can anyone direct me to good, current docs for Tkinter? Thanks, Ken
0
by: Guilherme Polo | last post by:
2008/5/10 Kenneth McDonald <kenneth.m.mcdonald@sbcglobal.net>: I will say no to the first question. Now about the second question.. there are these links you may find interesting: "An...
1
by: viv1tyagi | last post by:
Hi everyone ! ! ! I'm just a month old in the world of Python and trying to develop an application using Tkinter in which a new window pops out on a particular button press.The code for this new...
3
by: J-Burns | last post by:
Hello. Im a bit new to using Tkinter and im not a real pro in programming itself... :P. Need some help here. Problem 1: How do I make something appear on 2 separate windows using Tkinter? By...
2
by: mcfly | last post by:
I can apply my python code using import tkinter within the python shell and it works perfectly (i open some file using tkinter). however, when i try to run the file.py from the command prompt...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.