Placing Transparent image over image

uahmed gleam.uahmed at gmail.com
Sun Feb 6 12:33:34 EST 2011


Hi ,

I have 2 images and one on button and another one as a label i want that
when label image comes on button so it show the transparent part of image ,
i have made this code but in this the transparent part is hide .


Here is my code

import fcntl, sys
import sys
import Skype4Py
import functools
import os
import time
from Tkinter import *
import Image
import ImageTk

root = Tk()
pic2a_dest = "pic2a.png"
pic2a_open =Image.open(pic2a_dest)
pic2a_handle = ImageTk.PhotoImage(pic2a_open)
button1 = Button (root , image = pic2a_handle)
button1.place(x=20,y=20)


pic1a_dest = "pic1a.png"
pic1a_open =Image.open(pic1a_dest)
pic1a_handle = ImageTk.PhotoImage(pic1a_open)
label1 = Label (root , image = pic1a_handle)
label1.place(x=40,y=20)
root.mainloop()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110206/f29ae406/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic1a.png
Type: image/png
Size: 7168 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20110206/f29ae406/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic2a.png
Type: image/png
Size: 9568 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20110206/f29ae406/attachment-0001.png>


More information about the Python-list mailing list