1
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4
<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
5
<title>The PIL.ImageTk Module</title>
6
<link rel='stylesheet' href='effbot.css' type='text/css' />
9
<h1>The PIL.ImageTk Module</h1>
10
<p>The <b>ImageTk</b> module contains support to create and modify
11
Tkinter <b>BitmapImage</b> and <b>PhotoImage</b> objects.
13
For examples, see the demo programs in the <i>Scripts</i>
15
</p><h2>Module Contents</h2>
17
<dt><b>BitmapImage(image=None, **options)</b> (class) [<a href='#PIL.ImageTk.BitmapImage-class'>#</a>]</dt>
19
<p>Create a Tkinter-compatible bitmap image.</p>
20
<p>For more information about this class, see <a href='#PIL.ImageTk.BitmapImage-class'><i>The BitmapImage Class</i></a>.</p>
22
<dt><a id='PIL.ImageTk.getimage-function' name='PIL.ImageTk.getimage-function'><b>getimage(photo)</b></a> [<a href='#PIL.ImageTk.getimage-function'>#</a>]</dt>
25
<dt><b>PhotoImage(image=None, size=None, **options)</b> (class) [<a href='#PIL.ImageTk.PhotoImage-class'>#</a>]</dt>
27
<p>Creates a Tkinter-compatible photo image.</p>
28
<p>For more information about this class, see <a href='#PIL.ImageTk.PhotoImage-class'><i>The PhotoImage Class</i></a>.</p>
31
<h2><a id='PIL.ImageTk.BitmapImage-class' name='PIL.ImageTk.BitmapImage-class'>The BitmapImage Class</a></h2>
33
<dt><b>BitmapImage(image=None, **options)</b> (class) [<a href='#PIL.ImageTk.BitmapImage-class'>#</a>]</dt>
36
<dt><a id='PIL.ImageTk.BitmapImage.__init__-method' name='PIL.ImageTk.BitmapImage.__init__-method'><b>__init__(image=None, **options)</b></a> [<a href='#PIL.ImageTk.BitmapImage.__init__-method'>#</a>]</dt>
38
<p>Create a Tkinter-compatible bitmap image.
40
The given image must have mode "1". Pixels having value 0 are
41
treated as transparent. Options, if any, are passed on to
42
Tkinter. The most commonly used option is <b>foreground</b>,
43
which is used to specify the colour for the non-transparent
44
parts. See the Tkinter documentation for information on how to
53
<dt><a id='PIL.ImageTk.BitmapImage.__str__-method' name='PIL.ImageTk.BitmapImage.__str__-method'><b>__str__()</b></a> [<a href='#PIL.ImageTk.BitmapImage.__str__-method'>#</a>]</dt>
61
<dt><a id='PIL.ImageTk.BitmapImage.height-method' name='PIL.ImageTk.BitmapImage.height-method'><b>height()</b></a> [<a href='#PIL.ImageTk.BitmapImage.height-method'>#</a>]</dt>
69
<dt><a id='PIL.ImageTk.BitmapImage.width-method' name='PIL.ImageTk.BitmapImage.width-method'><b>width()</b></a> [<a href='#PIL.ImageTk.BitmapImage.width-method'>#</a>]</dt>
78
<h2><a id='PIL.ImageTk.PhotoImage-class' name='PIL.ImageTk.PhotoImage-class'>The PhotoImage Class</a></h2>
80
<dt><b>PhotoImage(image=None, size=None, **options)</b> (class) [<a href='#PIL.ImageTk.PhotoImage-class'>#</a>]</dt>
83
<dt><a id='PIL.ImageTk.PhotoImage.__init__-method' name='PIL.ImageTk.PhotoImage.__init__-method'><b>__init__(image=None, size=None, **options)</b></a> [<a href='#PIL.ImageTk.PhotoImage.__init__-method'>#</a>]</dt>
85
<p>Create a photo image object. The constructor takes either
86
a PIL image, or a mode and a size. Alternatively, you can
87
use the <b>file</b> or <b>data</b> options to initialize
88
the photo image object.
100
<dt><i>data=</i></dt>
105
<dt><a id='PIL.ImageTk.PhotoImage.__str__-method' name='PIL.ImageTk.PhotoImage.__str__-method'><b>__str__()</b></a> [<a href='#PIL.ImageTk.PhotoImage.__str__-method'>#</a>]</dt>
113
<dt><a id='PIL.ImageTk.PhotoImage.height-method' name='PIL.ImageTk.PhotoImage.height-method'><b>height()</b></a> [<a href='#PIL.ImageTk.PhotoImage.height-method'>#</a>]</dt>
121
<dt><a id='PIL.ImageTk.PhotoImage.paste-method' name='PIL.ImageTk.PhotoImage.paste-method'><b>paste(im, box=None)</b></a> [<a href='#PIL.ImageTk.PhotoImage.paste-method'>#</a>]</dt>
132
<dt><a id='PIL.ImageTk.PhotoImage.width-method' name='PIL.ImageTk.PhotoImage.width-method'><b>width()</b></a> [<a href='#PIL.ImageTk.PhotoImage.width-method'>#</a>]</dt>