Mercurial > pygame
annotate docs/ref/image.html @ 3172:d1b367fc08bc tests-returncode
Use a return code of 1 when the tests fail.
| author | Thomas Kluyver <takowl@gmail.com> |
|---|---|
| date | Wed, 09 Jan 2013 10:13:57 +0000 |
| parents | 8d9ce368f8d3 |
| children |
| rev | line source |
|---|---|
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 627 | 3 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
4 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
5 <head> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
7 |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
8 <title>pygame.image — Pygame v1.9.2 documentation</title> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
9 <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
10 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
11 <script type="text/javascript"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
12 var DOCUMENTATION_OPTIONS = { |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
13 URL_ROOT: '../', |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
14 VERSION: '1.9.2', |
| 2225 | 15 COLLAPSE_INDEX: false, |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
16 FILE_SUFFIX: '.html', |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
17 HAS_SOURCE: true |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
18 }; |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
19 </script> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
20 <script type="text/javascript" src="../_static/jquery.js"></script> |
| 2225 | 21 <script type="text/javascript" src="../_static/underscore.js"></script> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
22 <script type="text/javascript" src="../_static/doctools.js"></script> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
23 <link rel="shortcut icon" href="../_static/pygame.ico"/> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
24 <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
25 <link rel="next" title="pygame.joystick" href="joystick.html" /> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
26 <link rel="prev" title="pygame.gfxdraw" href="gfxdraw.html" /> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
27 </head> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
28 <body> |
| 627 | 29 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
30 <div class="document"> |
| 627 | 31 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
32 <div class="header"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
33 <table> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
34 <tr> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
35 <td class="logo"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
36 <a href="http://www.pygame.org/"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
37 <img src="../_static/pygame_tiny.png"/> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
38 </a> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
39 <h5>pygame documentation</h5> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
40 </td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
41 <td class="pagelinks"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
42 <p class="top"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
43 || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
44 <a href="http://www.pygame.org/">Pygame Home</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
45 <a href="../index.html">Help Contents</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
46 <a href="../genindex.html">Reference Index</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
47 </p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
48 <p class="bottom"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
49 <a href="camera.html">camera</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
50 <a href="cdrom.html">cdrom</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
51 <a href="color.html">Color</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
52 <a href="cursors.html">cursors</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
53 <a href="display.html">display</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
54 <a href="draw.html">draw</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
55 <a href="event.html">event</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
56 <a href="examples.html">examples</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
57 <a href="font.html">font</a> || |
|
3065
0a3be7313aa4
Enable pygame._freetype extension module build by default
Lenard Lindstrom <len-l@telus.net>
parents:
2239
diff
changeset
|
58 <a href="freetype.html">freetype</a> || |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
59 <a href="gfxdraw.html">gfxdraw</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
60 <a href="image.html">image</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
61 <a href="joystick.html">joystick</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
62 <a href="key.html">key</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
63 <a href="locals.html">locals</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
64 <a href="mask.html">mask</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
65 <a href="math.html">math</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
66 <a href="midi.html">midi</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
67 <a href="mixer.html">mixer</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
68 <a href="mouse.html">mouse</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
69 <a href="movie.html">movie</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
70 <a href="music.html">music</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
71 <a href="overlay.html">Overlay</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
72 <a href="pixelarray.html">PixelArray</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
73 <a href="pixelcopy.html">pixelcopy</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
74 <a href="pygame.html">pygame</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
75 <a href="rect.html">Rect</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
76 <a href="scrap.html">scrap</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
77 <a href="sndarray.html">sndarray</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
78 <a href="sprite.html">sprite</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
79 <a href="surface.html">Surface</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
80 <a href="surfarray.html">surfarray</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
81 <a href="tests.html">tests</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
82 <a href="time.html">time</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
83 <a href="transform.html">transform</a> || |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
84 <a href="pygame.html#module-pygame.version">version</a> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
85 </p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
86 </td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
87 </tr> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
88 </table> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
89 </div> |
| 627 | 90 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
91 <div class="documentwrapper"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
92 <div class="body"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
93 |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
94 <div class="sectionwrapper"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
95 <div class="section" id="module-pygame.image"> |
| 2225 | 96 <span id="pygame-image"></span><dl class="definition module"> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
97 <dt class="title module"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
98 <tt class="docutils literal"><span class="pre">pygame.image</span></tt></dt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
99 <dd><div class="line-block"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
100 <div class="line"><span class="summaryline">pygame module for image transfer</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
101 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
102 <table border="1" class="toc docutils"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
103 <colgroup> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
104 <col width="28%" /> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
105 <col width="1%" /> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
106 <col width="71%" /> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
107 </colgroup> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
108 <tbody valign="top"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
109 <tr><td><a class="toc reference external" href="image.html#pygame.image.load">pygame.image.load</a></td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
110 <td>—</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
111 <td>load new image from a file</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
112 </tr> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
113 <tr><td><a class="toc reference external" href="image.html#pygame.image.save">pygame.image.save</a></td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
114 <td>—</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
115 <td>save an image to disk</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
116 </tr> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
117 <tr><td><a class="toc reference external" href="image.html#pygame.image.get_extended">pygame.image.get_extended</a></td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
118 <td>—</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
119 <td>test if extended image formats can be loaded</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
120 </tr> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
121 <tr><td><a class="toc reference external" href="image.html#pygame.image.tostring">pygame.image.tostring</a></td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
122 <td>—</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
123 <td>transfer image to string buffer</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
124 </tr> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
125 <tr><td><a class="toc reference external" href="image.html#pygame.image.fromstring">pygame.image.fromstring</a></td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
126 <td>—</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
127 <td>create new Surface from a string buffer</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
128 </tr> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
129 <tr><td><a class="toc reference external" href="image.html#pygame.image.frombuffer">pygame.image.frombuffer</a></td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
130 <td>—</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
131 <td>create a new Surface that shares data inside a string buffer</td> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
132 </tr> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
133 </tbody> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
134 </table> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
135 <p>The image module contains functions for loading and saving pictures, as well as |
|
2214
d67ad33a728e
Update footer because of different sphinx version.
Rene Dudfield <renesd@gmail.com>
parents:
2198
diff
changeset
|
136 transferring Surfaces to formats usable by other packages. .</p> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
137 <p>Note that there is no Image class; an image is loaded as a Surface object. The |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
138 Surface class allows manipulation (drawing lines, setting pixels, capturing |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
139 regions, etc.).</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
140 <p>The image module is a required dependency of Pygame, but it only optionally |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
141 supports any extended file formats. By default it can only load uncompressed |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
142 <tt class="docutils literal"><span class="pre">BMP</span></tt> images. When built with full image support, the <tt class="docutils literal"><span class="pre">pygame.image.load()</span></tt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
143 function can support the following formats.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
144 <blockquote> |
|
3092
8d9ce368f8d3
Rebuild docs with Sphinx 1.0.2 and Docutils 0.7
Lenard Lindstrom <len-l@telus.net>
parents:
3065
diff
changeset
|
145 <ul class="simple"> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
146 <li><tt class="docutils literal"><span class="pre">JPG</span></tt></li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
147 <li><tt class="docutils literal"><span class="pre">PNG</span></tt></li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
148 <li><tt class="docutils literal"><span class="pre">GIF</span></tt> (non animated)</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
149 <li><tt class="docutils literal"><span class="pre">BMP</span></tt></li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
150 <li><tt class="docutils literal"><span class="pre">PCX</span></tt></li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
151 <li><tt class="docutils literal"><span class="pre">TGA</span></tt> (uncompressed)</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
152 <li><tt class="docutils literal"><span class="pre">TIF</span></tt></li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
153 <li><tt class="docutils literal"><span class="pre">LBM</span></tt> (and <tt class="docutils literal"><span class="pre">PBM</span></tt>)</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
154 <li><tt class="docutils literal"><span class="pre">PBM</span></tt> (and <tt class="docutils literal"><span class="pre">PGM</span></tt>, <tt class="docutils literal"><span class="pre">PPM</span></tt>)</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
155 <li><tt class="docutils literal"><span class="pre">XPM</span></tt></li> |
| 627 | 156 </ul> |
|
3092
8d9ce368f8d3
Rebuild docs with Sphinx 1.0.2 and Docutils 0.7
Lenard Lindstrom <len-l@telus.net>
parents:
3065
diff
changeset
|
157 </blockquote> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
158 <p>Saving images only supports a limited set of formats. You can save to the |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
159 following formats.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
160 <blockquote> |
|
3092
8d9ce368f8d3
Rebuild docs with Sphinx 1.0.2 and Docutils 0.7
Lenard Lindstrom <len-l@telus.net>
parents:
3065
diff
changeset
|
161 <ul class="simple"> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
162 <li><tt class="docutils literal"><span class="pre">BMP</span></tt></li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
163 <li><tt class="docutils literal"><span class="pre">TGA</span></tt></li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
164 <li><tt class="docutils literal"><span class="pre">PNG</span></tt></li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
165 <li><tt class="docutils literal"><span class="pre">JPEG</span></tt></li> |
| 627 | 166 </ul> |
|
3092
8d9ce368f8d3
Rebuild docs with Sphinx 1.0.2 and Docutils 0.7
Lenard Lindstrom <len-l@telus.net>
parents:
3065
diff
changeset
|
167 </blockquote> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
168 <p><tt class="docutils literal"><span class="pre">PNG</span></tt>, <tt class="docutils literal"><span class="pre">JPEG</span></tt> saving new in pygame 1.8.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
169 <dl class="definition function"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
170 <dt class="title" id="pygame.image.load"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
171 <tt class="descclassname">pygame.image.</tt><tt class="descname">load</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.load" title="Permalink to this definition">¶</a></dt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
172 <dd><div class="line-block"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
173 <div class="line"><span class="summaryline">load new image from a file</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
174 <div class="line"><span class="signature">load(filename) -> Surface</span></div> |
| 2225 | 175 <div class="line"><span class="signature">load(fileobj, namehint=””) -> Surface</span></div> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
176 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
177 <p>Load an image from a file source. You can pass either a filename or a Python |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
178 file-like object.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
179 <p>Pygame will automatically determine the image type (e.g., <tt class="docutils literal"><span class="pre">GIF</span></tt> or bitmap) |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
180 and create a new Surface object from the data. In some cases it will need to |
| 2225 | 181 know the file extension (e.g., <tt class="docutils literal"><span class="pre">GIF</span></tt> images should end in ”.gif”). If you |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
182 pass a raw file-like object, you may also want to pass the original filename |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
183 as the namehint argument.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
184 <p>The returned Surface will contain the same color format, colorkey and alpha |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
185 transparency as the file it came from. You will often want to call |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
186 <tt class="docutils literal"><span class="pre">Surface.convert()</span></tt> with no arguments, to create a copy that will draw |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
187 more quickly on the screen.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
188 <p>For alpha transparency, like in .png images use the <tt class="docutils literal"><span class="pre">convert_alpha()</span></tt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
189 method after loading so that the image has per pixel transparency.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
190 <p>Pygame may not always be built to support all image formats. At minimum it |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
191 will support uncompressed <tt class="docutils literal"><span class="pre">BMP</span></tt>. If <tt class="docutils literal"><span class="pre">pygame.image.get_extended()</span></tt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
192 returns ‘True’, you should be able to load most images (including png, jpg |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
193 and gif).</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
194 <p>You should use <tt class="docutils literal"><span class="pre">os.path.join()</span></tt> for compatibility.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
195 <div class="highlight-python"><div class="highlight"><pre><span class="n">eg</span><span class="o">.</span> <span class="n">asurf</span> <span class="o">=</span> <span class="n">pygame</span><span class="o">.</span><span class="n">image</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">'data'</span><span class="p">,</span> <span class="s">'bla.png'</span><span class="p">))</span> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
196 </pre></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
197 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
198 </dd></dl> |
| 627 | 199 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
200 <dl class="definition function"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
201 <dt class="title" id="pygame.image.save"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
202 <tt class="descclassname">pygame.image.</tt><tt class="descname">save</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.save" title="Permalink to this definition">¶</a></dt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
203 <dd><div class="line-block"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
204 <div class="line"><span class="summaryline">save an image to disk</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
205 <div class="line"><span class="signature">save(Surface, filename) -> None</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
206 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
207 <p>This will save your Surface as either a <tt class="docutils literal"><span class="pre">BMP</span></tt>, <tt class="docutils literal"><span class="pre">TGA</span></tt>, <tt class="docutils literal"><span class="pre">PNG</span></tt>, or |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
208 <tt class="docutils literal"><span class="pre">JPEG</span></tt> image. If the filename extension is unrecognized it will default to |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
209 <tt class="docutils literal"><span class="pre">TGA</span></tt>. Both <tt class="docutils literal"><span class="pre">TGA</span></tt>, and <tt class="docutils literal"><span class="pre">BMP</span></tt> file formats create uncompressed files.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
210 <p><tt class="docutils literal"><span class="pre">PNG</span></tt>, <tt class="docutils literal"><span class="pre">JPEG</span></tt> saving new in pygame 1.8.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
211 </dd></dl> |
| 627 | 212 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
213 <dl class="definition function"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
214 <dt class="title" id="pygame.image.get_extended"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
215 <tt class="descclassname">pygame.image.</tt><tt class="descname">get_extended</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.get_extended" title="Permalink to this definition">¶</a></dt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
216 <dd><div class="line-block"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
217 <div class="line"><span class="summaryline">test if extended image formats can be loaded</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
218 <div class="line"><span class="signature">get_extended() -> bool</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
219 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
220 <p>If pygame is built with extended image formats this function will return |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
221 True. It is still not possible to determine which formats will be available, |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
222 but generally you will be able to load them all.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
223 </dd></dl> |
| 627 | 224 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
225 <dl class="definition function"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
226 <dt class="title" id="pygame.image.tostring"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
227 <tt class="descclassname">pygame.image.</tt><tt class="descname">tostring</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.tostring" title="Permalink to this definition">¶</a></dt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
228 <dd><div class="line-block"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
229 <div class="line"><span class="summaryline">transfer image to string buffer</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
230 <div class="line"><span class="signature">tostring(Surface, format, flipped=False) -> string</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
231 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
232 <p>Creates a string that can be transferred with the ‘fromstring’ method in |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
233 other Python imaging packages. Some Python image packages prefer their |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
234 images in bottom-to-top format (PyOpenGL for example). If you pass True for |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
235 the flipped argument, the string buffer will be vertically flipped.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
236 <p>The format argument is a string of one of the following values. Note that |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
237 only 8bit Surfaces can use the “P” format. The other formats will work for |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
238 any Surface. Also note that other Python image packages support more formats |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
239 than Pygame.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
240 <blockquote> |
|
3092
8d9ce368f8d3
Rebuild docs with Sphinx 1.0.2 and Docutils 0.7
Lenard Lindstrom <len-l@telus.net>
parents:
3065
diff
changeset
|
241 <ul class="simple"> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
242 <li><tt class="docutils literal"><span class="pre">P</span></tt>, 8bit palettized Surfaces</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
243 <li><tt class="docutils literal"><span class="pre">RGB</span></tt>, 24bit image</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
244 <li><tt class="docutils literal"><span class="pre">RGBX</span></tt>, 32bit image with unused space</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
245 <li><tt class="docutils literal"><span class="pre">RGBA</span></tt>, 32bit image with an alpha channel</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
246 <li><tt class="docutils literal"><span class="pre">ARGB</span></tt>, 32bit image with alpha channel first</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
247 <li><tt class="docutils literal"><span class="pre">RGBA_PREMULT</span></tt>, 32bit image with colors scaled by alpha channel</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
248 <li><tt class="docutils literal"><span class="pre">ARGB_PREMULT</span></tt>, 32bit image with colors scaled by alpha channel, alpha channel first</li> |
| 627 | 249 </ul> |
|
3092
8d9ce368f8d3
Rebuild docs with Sphinx 1.0.2 and Docutils 0.7
Lenard Lindstrom <len-l@telus.net>
parents:
3065
diff
changeset
|
250 </blockquote> |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
251 </dd></dl> |
| 627 | 252 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
253 <dl class="definition function"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
254 <dt class="title" id="pygame.image.fromstring"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
255 <tt class="descclassname">pygame.image.</tt><tt class="descname">fromstring</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.fromstring" title="Permalink to this definition">¶</a></dt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
256 <dd><div class="line-block"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
257 <div class="line"><span class="summaryline">create new Surface from a string buffer</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
258 <div class="line"><span class="signature">fromstring(string, size, format, flipped=False) -> Surface</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
259 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
260 <p>This function takes arguments similar to <tt class="docutils literal"><span class="pre">pygame.image.tostring()</span></tt>. The |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
261 size argument is a pair of numbers representing the width and height. Once |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
262 the new Surface is created you can destroy the string buffer.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
263 <p>The size and format image must compute the exact same size as the passed |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
264 string buffer. Otherwise an exception will be raised.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
265 <p>See the <tt class="docutils literal"><span class="pre">pygame.image.frombuffer()</span></tt> method for a potentially faster way to |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
266 transfer images into Pygame.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
267 </dd></dl> |
| 627 | 268 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
269 <dl class="definition function"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
270 <dt class="title" id="pygame.image.frombuffer"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
271 <tt class="descclassname">pygame.image.</tt><tt class="descname">frombuffer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.frombuffer" title="Permalink to this definition">¶</a></dt> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
272 <dd><div class="line-block"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
273 <div class="line"><span class="summaryline">create a new Surface that shares data inside a string buffer</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
274 <div class="line"><span class="signature">frombuffer(string, size, format) -> Surface</span></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
275 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
276 <p>Create a new Surface that shares pixel data directly from the string buffer. |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
277 This method takes the same arguments as <tt class="docutils literal"><span class="pre">pygame.image.fromstring()</span></tt>, but |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
278 is unable to vertically flip the source data.</p> |
| 2225 | 279 <p>This will run much faster than <a class="tooltip reference internal" href="#pygame.image.fromstring" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.image.fromstring()</span></tt><span class="tooltip-content">create new Surface from a string buffer</span></a>, since no |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
280 pixel data must be allocated and copied.</p> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
281 </dd></dl> |
| 627 | 282 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
283 </dd></dl> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
284 |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
285 </div> |
| 627 | 286 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
287 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
288 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
289 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
290 <div class="clearer"></div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
291 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
292 <div class="related"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
293 <h3>Navigation</h3> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
294 <ul> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
295 <li class="right" style="margin-right: 10px"> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
296 <a href="../genindex.html" title="General Index" |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
297 accesskey="I">index</a></li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
298 <li class="right" > |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
299 <a href="joystick.html" title="pygame.joystick" |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
300 accesskey="N">next</a> |</li> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
301 <li class="right" > |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
302 <a href="gfxdraw.html" title="pygame.gfxdraw" |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
303 accesskey="P">previous</a> |</li> |
|
2239
ca88e9308d44
regenerated html docs. Should all have doc comments from the website now.
Rene Dudfield <renesd@gmail.com>
parents:
2225
diff
changeset
|
304 <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> |
|
ca88e9308d44
regenerated html docs. Should all have doc comments from the website now.
Rene Dudfield <renesd@gmail.com>
parents:
2225
diff
changeset
|
305 <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> |
|
ca88e9308d44
regenerated html docs. Should all have doc comments from the website now.
Rene Dudfield <renesd@gmail.com>
parents:
2225
diff
changeset
|
306 |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
307 </ul> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
308 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
309 <div class="footer"> |
| 2225 | 310 © Copyright 2011, Pygame Developers. |
|
2198
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
311 </div> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
312 </body> |
|
da4302429d3b
replace makeref.py generated documents with makeref2.py documents
Lenard Lindstrom <len-l@telus.net>
parents:
2166
diff
changeset
|
313 </html> |
