1
<html><head><title>Module PIL.ImageWin</title><link href="pythondoc.css" rel="stylesheet" title="style" /></head><body><h1>Module PIL.ImageWin</h1><h4>Module Summary:</h4><pre><a href="#47">class Dib</a>:
2
def __init__(self, image, size=None)</pre><blockquote>Create a Windows bitmap with the given mode and size.</blockquote><pre><a href="#23">class HDC</a>:
3
def __init__(self)</pre><blockquote>The ImageWin module contains support to create and display
4
images under Windows 95/98, NT, 2000 and later.</blockquote><h2>Classes</h2><div class="class" id="47"><h3>The Dib Class</h3><pre>Dib()</pre><p>Create a Windows bitmap with the given mode and size. The mode can
5
be one of "1", "L", "P", or "RGB".
7
If the display requires a palette, this constructor creates a
8
suitable palette and associates it with the image. For an "L" image,
9
128 greylevels are allocated. For an "RGB" image, a 6x6x6 colour
10
cube is used, together with 20 greylevels.
12
To make sure that palettes work properly under Windows, you must
13
call the <b>palette</b> method upon certain events from Windows.
14
</p></div><h4>Constructor:</h4><div class="constructor" id="58"><pre>Dib(image, size=None)</pre><p>Create Windows bitmap.
16
</p><h4>Parameters:</h4><p><code>image</code> -- Either a PIL image, or a mode string. If a
17
mode string is used, a size must also be given. The
18
mode can be one of "1", "L", "P", or "RGB".
19
</p><p><code>size</code> -- If the first argument is a mode string, this
20
defines the size of the image.
21
</p></div><h4>Method Summary:</h4><pre><a href="#81">expose(handle)</a></pre><blockquote>Copy the bitmap contents to a device context.</blockquote><pre><a href="#141">paste(im, box=None)</a></pre><blockquote>Paste a PIL image into the bitmap image.</blockquote><pre><a href="#120">query_palette(dc)</a></pre><blockquote>Installs the palette associated with the image in the
22
given device context.</blockquote><div class="method" id="81"><h3>expose</h3><pre>expose(handle)</pre><p>Copy the bitmap contents to a device context.
24
</p><h4>Parameters:</h4><p><code>handle</code> -- Device context (HDC), cast to a Python integer,
25
or a HDC or HWND instance. In PythonWin, you can use the
26
<b>GetHandleAttrib</b> method of the <b>CDC</b> class to get
28
</p></div><div class="method" id="141"><h3>paste</h3><pre>paste(im, box=None)</pre><p>Paste a PIL image into the bitmap image.
30
</p><h4>Parameters:</h4><p><code>im</code> -- A PIL image. The size must match the target region.
31
If the mode does not match, the image is converted to the
32
mode of the bitmap image.
33
</p><p><code>box</code> -- A 4-tuple defining the left, upper, right, and
34
lower pixel coordinate. If None is given instead of a
35
tuple, all of the image is assumed.
36
</p></div><div class="method" id="120"><h3>query_palette</h3><pre>query_palette(dc)</pre><p>Installs the palette associated with the image in the
39
This method should be called upon <b>QUERYNEWPALETTE</b>
40
and <b>PALETTECHANGED</b> events from Windows. If this
41
method returns a non-zero value, one or more display
42
palette entries were changed, and the image should be
45
</p><h4>Parameters:</h4><p><code>dc</code> -- Device context (HDC), cast to a Python integer,
46
or an HDC or HWND instance.
47
</p><h4>Returns:</h4><p>A true value if one or more entries were changed
48
(this indicates that the image should be redrawn).
49
</p></div><div class="class" id="23"><h3>The HDC Class</h3><pre>HDC()</pre><p>The <b>ImageWin</b> module contains support to create and display
50
images under Windows 95/98, NT, 2000 and later.
51
</p></div></body></html>
b'\\ No newline at end of file'