473,288 Members | 1,750 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,288 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 11129
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.