~ubuntu-branches/debian/squeeze/python-imaging/squeeze

« back to all changes in this revision

Viewing changes to PIL/ImageTk.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-08-28 23:14:10 UTC
  • mfrom: (2.1.5 edgy)
  • Revision ID: james.westby@ubuntu.com-20060828231410-lca9enmne3ecmkup
Tags: 1.1.5-11
* python-imaging-sane: Depend on python-numarray. Closes: #382190.
* Add dependencies on ${shlibs:Depends}, lost in -6. Closes: #378596.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
2
# The Python Imaging Library.
3
 
# $Id: //modules/pil/PIL/ImageTk.py#3 $
 
3
# $Id: ImageTk.py 2134 2004-10-06 08:55:20Z fredrik $
4
4
#
5
5
# a Tk display interface
6
6
#
33
33
# <p>
34
34
# For examples, see the demo programs in the <i>Scripts</i>
35
35
# directory.
 
36
##
36
37
 
37
38
# --------------------------------------------------------------------
38
39
# Check for Tkinter interface hooks
46
47
            im = Image.new("1", (1,1))
47
48
            Tkinter.BitmapImage(data="PIL:%d" % im.im.id)
48
49
            _pilbitmap_ok = 1
49
 
        except:
 
50
        except Tkinter.TclError:
50
51
            _pilbitmap_ok = 0
51
52
    return _pilbitmap_ok
52
53
 
110
111
        self.__mode = mode
111
112
        self.__size = size
112
113
        self.__photo = apply(Tkinter.PhotoImage, (), kw)
 
114
        self.tk = self.__photo.tk
113
115
        if image:
114
116
            self.paste(image)
115
117
 
266
268
    def __str__(self):
267
269
        return str(self.__photo)
268
270
 
 
271
##
 
272
# Copies the contents of a PhotoImage to a PIL image memory.
 
273
 
 
274
def getimage(photo):
 
275
    photo.tk.call("PyImagingPhotoGet", photo)
269
276
 
270
277
# --------------------------------------------------------------------
271
278
# Helper for the Image.show method.