| | |
Transparent letters in Tkinter?
Thread Solved |
I have an image being displayed in a Tkinter window. I need a way to add letters to the image in certain spots depending on what is done by the user. Example: if button 1 is pressed, the peoples names appear over their heads, but I can't just switch the image for a new one with the names there. I need to be able to make it so the user could enter in the name of the person, and then THAT name will appear over top of the persons head.
Any ideas how this could be done? And I the title is transparent letters because it would be awesome if the text didn't have a white background or boarder or anything like that.
Thanks for your help in advance everyone!
Any ideas how this could be done? And I the title is transparent letters because it would be awesome if the text didn't have a white background or boarder or anything like that.
Thanks for your help in advance everyone!
•
•
Join Date: Sep 2005
Posts: 133
Reputation:
Solved Threads: 58
Hi!
If you do all this in a Canvas, that's very easy:
Regards, mawe
If you do all this in a Canvas, that's very easy:
Python Syntax (Toggle Plain Text)
import Tkinter as tk root = tk.Tk() c = tk.Canvas() c.pack() # the image image = PhotoImage(file="whatever.gif") c.create_image(0, 0, image=image) # and now the text at coordinates (50, 50) c.create_text(50, 50, text="whatever", fill="blue") root.mainloop()
Regards, mawe
![]() |
Similar Threads
- Problem installing/ghosting new hard drive (Storage)
- Dots-and-Boxes game - RFC (Python)
- Transparent Icons on Desktop? (Windows NT / 2000 / XP)
- Dual Drive Letters in XP PRO~One Drive! (Windows NT / 2000 / XP)
- Change Drive Letters in Windows XP (Windows tips 'n' tweaks)
- Screen saver/transparent window...Help! (OS X)
- XP Disk Manager Drive Letters (Windows NT / 2000 / XP)
Other Threads in the Python Forum
- Previous Thread: Changing control sizes at run-time
- Next Thread: scoket problems
| Thread Tools | Search this Thread |
abrupt ansi anti apache approximation array assignment avogadro backend beginner binary book builtin calculator character code converter countpasswordentry curved customdialog dan08 dictionaries dictionary dynamic examples exe file float format function gnu graphics gui heads homework import inches input java launcher library line lines linux list lists loop mouse mysql mysqlquery number numbers numeric output parsing path phonebook plugin pointer port prime programming progressbar projects py2exe pygame pysimplewizard python random recursion redirect scrolledtext software statictext statistics string strings sum table terminal text textarea thread threading time tlapse trick tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable wordgame write wxpython xlib





