1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.gdk.Pixbuf</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gdk-class-reference.html" title="The gtk.gdk Class Reference"><link rel="previous" href="class-gdkkeymap.html" title="gtk.gdk.Keymap"><link rel="next" href="class-gdkpixbufanimation.html" title="gtk.gdk.PixbufAnimation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.gdk.Pixbuf</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gdkkeymap.html">Prev</a></td><th width="60%" align="center">The gtk.gdk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gdkpixbufanimation.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gdkpixbuf"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.gdk.Pixbuf</h2><p>gtk.gdk.Pixbuf — an object containing a client side image.</p></div><div class="refsect1" lang="en"><a name="id2949358"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.gdk.Pixbuf</span></span>(<span class="ooclass"><span class="classname"><a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gdkpixbuf.html#constructor-gdkpixbuf" title="Constructor">gtk.gdk.Pixbuf</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>colorspace</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>has_alpha</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>bits_per_sample</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--render-to-drawable" title="gtk.gdk.Pixbuf.render_to_drawable">render_to_drawable</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>drawable</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>gc</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dither</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>x_dither</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y_dither</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--render-to-drawable-alpha" title="gtk.gdk.Pixbuf.render_to_drawable_alpha">render_to_drawable_alpha</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>drawable</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>alpha_mode</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>alpha_threshold</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dither</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>x_dither</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y_dither</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--render-pixmap-and-mask" title="gtk.gdk.Pixbuf.render_pixmap_and_mask">render_pixmap_and_mask</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>alpha_threshold</tt></b></span><span class="initializer">=127</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-from-drawable" title="gtk.gdk.Pixbuf.get_from_drawable">get_from_drawable</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cmap</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-from-image" title="gtk.gdk.Pixbuf.get_from_image">get_from_image</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cmap</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-colorspace" title="gtk.gdk.Pixbuf.get_colorspace">get_colorspace</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-n-channels" title="gtk.gdk.Pixbuf.get_n_channels">get_n_channels</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-has-alpha" title="gtk.gdk.Pixbuf.get_has_alpha">get_has_alpha</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-bits-per-sample" title="gtk.gdk.Pixbuf.get_bits_per_sample">get_bits_per_sample</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-pixels" title="gtk.gdk.Pixbuf.get_pixels">get_pixels</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-width" title="gtk.gdk.Pixbuf.get_width">get_width</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-height" title="gtk.gdk.Pixbuf.get_height">get_height</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-rowstride" title="gtk.gdk.Pixbuf.get_rowstride">get_rowstride</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-option" title="gtk.gdk.Pixbuf.get_option">get_option</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>key</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--copy" title="gtk.gdk.Pixbuf.copy">copy</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--fill" title="gtk.gdk.Pixbuf.fill">fill</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>pixel</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--save" title="gtk.gdk.Pixbuf.save">save</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filename</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>options</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--add-alpha" title="gtk.gdk.Pixbuf.add_alpha">add_alpha</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>substitute_color</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>r</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>g</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>b</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--copy-area" title="gtk.gdk.Pixbuf.copy_area">copy_area</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_pixbuf</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--saturate-and-pixelate" title="gtk.gdk.Pixbuf.saturate_and_pixelate">saturate_and_pixelate</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>saturation</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>pixelate</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--scale" title="gtk.gdk.Pixbuf.scale">scale</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--composite" title="gtk.gdk.Pixbuf.composite">composite</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>overall_alpha</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--composite-color" title="gtk.gdk.Pixbuf.composite_color">composite_color</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>overall_alpha</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>check_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>check_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>check_size</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>color1</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>color2</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--scale-simple" title="gtk.gdk.Pixbuf.scale_simple">scale_simple</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--composite-color-simple" title="gtk.gdk.Pixbuf.composite_color_simple">composite_color_simple</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>overall_alpha</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>check_size</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>color1</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>color2</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--get-pixels-array" title="gtk.gdk.Pixbuf.get_pixels_array">get_pixels_array</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#method-gdkpixbuf--subpixbuf" title="gtk.gdk.Pixbuf.subpixbuf">subpixbuf</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code><br></pre></td></tr></table><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
<span class="bold"><b>Functions</b></span>
<code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#function-gdk--pixbuf-new-from-file" title="gtk.gdk.pixbuf_new_from_file">gtk.gdk.pixbuf_new_from_file</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filename</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#function-gdk--pixbuf-new-from-file-at-size" title="gtk.gdk.pixbuf_new_from_file_at_size">gtk.gdk.pixbuf_new_from_file_at_size</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filename</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#function-gdk--pixbuf-new-from-data" title="gtk.gdk.pixbuf_new_from_data">gtk.gdk.pixbuf_new_from_data</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>colorspace</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>has_alpha</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>bits_per_sample</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>rowstride</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#function-gdk--pixbuf-new-from-array" title="gtk.gdk.pixbuf_new_from_array">gtk.gdk.pixbuf_new_from_array</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>array</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>colorspace</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>bits_per_sample</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#function-gdk--pixbuf-new-from-xpm-data" title="gtk.gdk.pixbuf_new_from_xpm_data">gtk.gdk.pixbuf_new_from_xpm_data</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#function-gdk--pixbuf-new-from-inline" title="gtk.gdk.pixbuf_new_from_inline">gtk.gdk.pixbuf_new_from_inline</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>data_length</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>copy_pixels</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#function-gdk--pixbuf-get-formats" title="gtk.gdk.pixbuf_get_formats">gtk.gdk.pixbuf_get_formats</a></span>()</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gdkpixbuf.html#function-gdk--pixbuf-get-file-info" title="gtk.gdk.pixbuf_get_file_info">gtk.gdk.pixbuf_get_file_info</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filename</tt></b></span></span>)</code></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id2954449"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf">gtk.gdk.Pixbuf</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id2940362"></a><h2>Attributes</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table cellpadding="5" width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"pixel_array"</td><td valign="top">Read</td><td valign="top">A numeric array containing the pixel values of the
<a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>. The
contents of the numeric array can be changed even though the array is
read-only. However you cannot change the pixel data of pixbufs that are
backed by a const string such as stock icon pixbufs.
<tt class="literal">PyGTK</tt> must be compiled with Numeric Python support for
this to work.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2929918"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"bits-per-sample"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">The number of bits per sample. Available in GTK+ 2.4
and above.</td></tr><tr valign="top"><td valign="top">"colorspace"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">The colorspace in which the samples are interpreted.Available in GTK+ 2.4 and above.</td></tr><tr valign="top"><td valign="top">"has-alpha"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">If <tt class="literal">TRUE</tt>,the pixbuf has an alpha
channel. Available in GTK+ 2.4 and above.</td></tr><tr valign="top"><td valign="top">"height"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">The number of rows of the pixbuf. Available in GTK+ 2.4
and above.</td></tr><tr valign="top"><td valign="top">"n-channels"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">The number of samples per pixel. Available in GTK+ 2.4
and above.</td></tr><tr valign="top"><td valign="top">"pixels"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">A pointer to the pixel data of the pixbuf. Available
in GTK+ 2.4 and above.</td></tr><tr valign="top"><td valign="top">"rowstride"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">The number of bytes between the start of a row and
the start of the next row. Available in GTK+ 2.4 and above.</td></tr><tr valign="top"><td valign="top">"width"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">The number of columns of the pixbuf. Available in GTK+ 2.4
and above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3003507"></a><h2>Description</h2><p>A <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
object contains the data that describes an image using client side
resources. By contrast a <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a> uses
server side resources to hold image data. Manipulating the image data in a
<a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a>
may involve round trip transfers between a client and a server in X11 while
manipulating image data in a <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
involves only client side operations. Therefore using <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
objects may be more efficient than using <a href="class-gdkpixmap.html" title="gtk.gdk.Pixmap"><tt class="classname">gtk.gdk.Pixmap</tt></a>
objects if a lot of image manipulation is necessary.</p><p>In addition to the methods associated with a <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
object there are a number of functions that can be used to create <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
objects from file and inline data.</p></div><div class="refsect1" lang="en"><a name="constructor-gdkpixbuf"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.gdk.Pixbuf</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>colorspace</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>has_alpha</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>bits_per_sample</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>colorspace</tt></b>:</span></td><td>the color space for the image - currently only
<tt class="literal">gtk.gdk.COLORSPACE_RGB</tt>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>has_alpha</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> the image will have
transparency information.</td></tr><tr><td><span class="term"><b class="parameter"><tt>bits_per_sample</tt></b>:</span></td><td>the number of bits per color sample - currently
must be 8.</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>the width of image in
pixels.</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>the height of image in
pixels.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a newly-created <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>.</td></tr></tbody></table><p>Creates a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
structure and allocates a buffer for it. The buffer has an optimal
rowstride. Note that the buffer is not cleared; you will have to fill it
completely yourself. The size of the image is specified by
<i class="parameter"><tt>width</tt></i> and <i class="parameter"><tt>height</tt></i>.</p></div><div class="refsect1" lang="en"><a name="id3143748"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gdkpixbuf--render-to-drawable"></a><h3>gtk.gdk.Pixbuf.render_to_drawable</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">render_to_drawable</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>drawable</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>gc</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dither</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>x_dither</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y_dither</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>drawable</tt></b>:</span></td><td>the destination <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>gc</tt></b>:</span></td><td>the <a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a> used for
rendering.</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_x</tt></b>:</span></td><td>the X coordinate within the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_y</tt></b>:</span></td><td>the Y coordinate within the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_x</tt></b>:</span></td><td>the X coordinate within
<i class="parameter"><tt>drawable</tt></i>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_y</tt></b>:</span></td><td>the Y coordinate within
<i class="parameter"><tt>drawable</tt></i>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>the width of region to render, in pixels, or -1
to use pixbuf width</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>the height of region to render, in pixels, or
-1 to use pixbuf height</td></tr><tr><td><span class="term"><b class="parameter"><tt>dither</tt></b>:</span></td><td>the dithering mode.</td></tr><tr><td><span class="term"><b class="parameter"><tt>x_dither</tt></b>:</span></td><td>the X offset for
dithering.</td></tr><tr><td><span class="term"><b class="parameter"><tt>y_dither</tt></b>:</span></td><td>the Y offset for
dithering.</td></tr></tbody></table><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method is deprecated in PyGTK 2.2 and above. Use the
<a href="class-gdkdrawable.html#method-gdkdrawable--draw-pixbuf" title="gtk.gdk.Drawable.draw_pixbuf"><tt class="methodname">gtk.gdk.Drawable.draw_pixbuf</tt>()</a>
method instead.</p></div><p>The <tt class="methodname">render_to_drawable</tt>() method renders
a rectangular portion of the pixbuf to a <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>
specified by <i class="parameter"><tt>drawable</tt></i> while using the <a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a> specified by
<i class="parameter"><tt>gc</tt></i>. This is done using GdkRGB, so the specified
drawable must have the GdkRGB visual and colormap. Note that this method
will ignore the opacity information for images with an alpha channel; the
<a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a> must
already have the clipping mask set if you want transparent regions to show
through.</p><p>The dither offset is important when re-rendering partial regions
of an image to a rendered version of the full image, or when the offsets to
a base position change, as in scrolling. The dither matrix has to be shifted
for consistent visual results. If you do not have any of these cases, the
dither offsets can be both zero.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--render-to-drawable-alpha"></a><h3>gtk.gdk.Pixbuf.render_to_drawable_alpha</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">render_to_drawable_alpha</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>drawable</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>alpha_mode</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>alpha_threshold</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dither</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>x_dither</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>y_dither</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>drawable</tt></b>:</span></td><td>the destination <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>gc</tt></b>:</span></td><td>the <a href="class-gdkgc.html" title="gtk.gdk.GC"><tt class="classname">gtk.gdk.GC</tt></a> used for
rendering.</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_x</tt></b>:</span></td><td>the X coordinate within the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_y</tt></b>:</span></td><td>the Y coordinate within the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_x</tt></b>:</span></td><td>the X coordinate within
<i class="parameter"><tt>drawable</tt></i>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_y</tt></b>:</span></td><td>the Y coordinate within
<i class="parameter"><tt>drawable</tt></i>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>the width of region to render, in pixels, or -1
to use pixbuf width</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>the height of region to render, in pixels, or
-1 to use pixbuf height</td></tr><tr><td><span class="term"><b class="parameter"><tt>alpha_mode</tt></b>:</span></td><td>Ignored. Present for backward
compatibility.</td></tr><tr><td><span class="term"><b class="parameter"><tt>alpha_threshold</tt></b>:</span></td><td>Ignored. Present for backward
compatibility</td></tr><tr><td><span class="term"><b class="parameter"><tt>dither</tt></b>:</span></td><td>the dithering mode.</td></tr><tr><td><span class="term"><b class="parameter"><tt>x_dither</tt></b>:</span></td><td>the X offset for
dithering.</td></tr><tr><td><span class="term"><b class="parameter"><tt>y_dither</tt></b>:</span></td><td>the Y offset for
dithering.</td></tr></tbody></table><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method is deprecated in PyGTK 2.2 and above. Use the
<a href="class-gdkdrawable.html#method-gdkdrawable--draw-pixbuf" title="gtk.gdk.Drawable.draw_pixbuf"><tt class="methodname">gtk.gdk.Drawable.draw_pixbuf</tt>()</a>
method instead.</p></div><p>The <tt class="methodname">render_to_drawable_alpha</tt>() method
renders a rectangular portion of the pixbuf to a <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>
specified by <i class="parameter"><tt>drawable</tt></i>.
<i class="parameter"><tt>drawable</tt></i> must have a colormap. All windows have a
colormap; however, pixmaps only have colormap by default if they were
created with a window argument.specifying a <a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a>.
Otherwise a colormap must be set on them with the <a href="class-gdkdrawable.html#method-gdkdrawable--set-colormap" title="gtk.gdk.Drawable.set_colormap"><tt class="methodname">gtk.gdk.Drawable.set_colormap</tt>()</a>
method. On older X servers, rendering pixbufs with an alpha channel involves
round trips to the X server, and may be somewhat slow.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--render-pixmap-and-mask"></a><h3>gtk.gdk.Pixbuf.render_pixmap_and_mask</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">render_pixmap_and_mask</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>alpha_threshold</tt></b></span><span class="initializer">=127</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>alpha_threshold</tt></b>:</span></td><td>the threshold value for opacity
values.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a tuple containing the created pixmap and
mask.</td></tr></tbody></table><p>The <tt class="methodname">render_to_pixmap_and_mask</tt>() method
returns a tuple containing a pixmap and a mask bitmap that the pixbuf and
its corresponding thresholded alpha mask are rendered to. This is merely a
convenience method; applications that need to render pixbufs with dither
offsets or to specific drawables should use the <a href="class-gdkpixbuf.html#method-gdkpixbuf--render-to-drawable-alpha" title="gtk.gdk.Pixbuf.render_to_drawable_alpha"><tt class="methodname">render_to_drawable_alpha</tt>()</a>
or <a href="class-gdkpixbuf.html#method-gdkpixbuf--render-to-drawable" title="gtk.gdk.Pixbuf.render_to_drawable"><tt class="methodname">render_to_drawable</tt>()</a>
methods. If the pixbuf does not have an alpha channel, then the mask
returned will be None.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-from-drawable"></a><h3>gtk.gdk.Pixbuf.get_from_drawable</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_from_drawable</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cmap</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>src</tt></b>:</span></td><td>the source <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>cmap</tt></b>:</span></td><td>a colormap if <i class="parameter"><tt>src</tt></i>
doesn't have one set.</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_x</tt></b>:</span></td><td>the X coordinate within
<i class="parameter"><tt>drawable</tt></i>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_y</tt></b>:</span></td><td>the Y coordinate within
<i class="parameter"><tt>drawable</tt></i>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_x</tt></b>:</span></td><td>the X coordinate in the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_y</tt></b>:</span></td><td>the Y coordinate in the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>the width in pixels of the region to
get.</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>the height in pixels of the region to
get.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the pixbuf or <tt class="literal">None</tt> on
error</td></tr></tbody></table><p>The <tt class="methodname">get_from_drawable</tt>() method
transfers image data from the <a href="class-gdkdrawable.html" title="gtk.gdk.Drawable"><tt class="classname">gtk.gdk.Drawable</tt></a>
specified by <i class="parameter"><tt>src</tt></i> and converts it to an RGB(A)
representation inside a <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>. In
other words, copies image data from a server-side drawable to a client-side
RGB(A) buffer. This allows you to efficiently read individual pixels on the
client side. If <i class="parameter"><tt>src</tt></i> has no colormap (the <a href="class-gdkdrawable.html#method-gdkdrawable--get-colormap" title="gtk.gdk.Drawable.get_colormap"><tt class="methodname">gtk.gdk.Drawable.get_colormap</tt>()</a>
method returns <tt class="literal">None</tt>), then a suitable colormap must be
specified as <i class="parameter"><tt>cmap</tt></i>. Typically a <a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a> or a
pixmap created by passing a <a href="class-gdkwindow.html" title="gtk.gdk.Window"><tt class="classname">gtk.gdk.Window</tt></a> to
<tt class="function">gtk.gdk.Pixmap()</tt> will already have a colormap
associated with it. If <i class="parameter"><tt>src</tt></i> has a colormap, the
<i class="parameter"><tt>cmap</tt></i> argument will be ignored. If
<i class="parameter"><tt>src</tt></i> is a bitmap (1 bit per pixel pixmap), then a
colormap is not required; pixels with a value of 1 are assumed to be white,
and pixels with a value of 0 are assumed to be black. For taking
screenshots, the <a href="class-gdkcolormap.html#function-gdk--colormap-get-system" title="gtk.gdk.colormap_get_system"><tt class="methodname">gtk.gdk.colormap_get_system</tt>()</a>
function returns the correct colormap to use.</p><p>If <i class="parameter"><tt>src</tt></i> is a pixmap, then the requested
source rectangle must be completely contained within the pixmap, otherwise
the function will return <tt class="literal">None</tt>. For pixmaps only (not for
windows) passing -1 for <i class="parameter"><tt>width</tt></i> or
<i class="parameter"><tt>height</tt></i> is allowed to mean the full width or height of
the pixmap. If <i class="parameter"><tt>src</tt></i> is a window, and the window
is off the screen, then there is no image data in the obscured/offscreen
regions to be placed in the pixbuf. The contents of portions of the pixbuf
corresponding to the offscreen region are undefined.</p><p>If the window you're obtaining data from is partially obscured
by other windows, then the contents of the pixbuf areas corresponding to the
obscured regions are undefined. If the target drawable is not mapped
(typically because it's iconified/minimized or not on the current
workspace), <tt class="literal">None</tt> will be returned. If memory can't be
allocated for the return value, <tt class="literal">None</tt> will be returned
instead. (In short, there are several ways this method can fail, and if it
fails it returns <tt class="literal">None</tt>; so check the return value.)</p><p>This method calls the <a href="class-gdkdrawable.html#method-gdkdrawable--get-image" title="gtk.gdk.Drawable.get_image"><tt class="methodname">gtk.gdk.Drawable.get_image</tt>()</a>
method internally and converts the resulting image to a <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>, so
the documentation for the <a href="class-gdkdrawable.html#method-gdkdrawable--get-image" title="gtk.gdk.Drawable.get_image"><tt class="methodname">gtk.gdk.Drawable.get_image</tt>()</a>
method may also be helpful.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-from-image"></a><h3>gtk.gdk.Pixbuf.get_from_image</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_from_image</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>cmap</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>src</tt></b>:</span></td><td>the source <a href="class-gdkimage.html" title="gtk.gdk.Image"><tt class="classname">gtk.gdk.Image</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>cmap</tt></b>:</span></td><td>a colormap if <i class="parameter"><tt>src</tt></i>
doesn't have one set or <tt class="literal">None</tt>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_x</tt></b>:</span></td><td>the X coordinate within
<i class="parameter"><tt>src</tt></i>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_y</tt></b>:</span></td><td>the Y coordinate within
<i class="parameter"><tt>src</tt></i>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_x</tt></b>:</span></td><td>the X coordinate in the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_y</tt></b>:</span></td><td>the Y coordinate in the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>the width in pixels of the region to
get.</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>the height in pixels of the region to
get.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the pixbuf or <tt class="literal">None</tt> on
error</td></tr></tbody></table><p>The <tt class="methodname">get_from_image</tt>() method is the same
as the <a href="class-gdkpixbuf.html#method-gdkpixbuf--get-from-drawable" title="gtk.gdk.Pixbuf.get_from_drawable"><tt class="methodname">get_from_drawable</tt>()</a>
method but gets the pixbuf from the <a href="class-gdkimage.html" title="gtk.gdk.Image"><tt class="classname">gtk.gdk.Image</tt></a>
specified by <i class="parameter"><tt>src</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-colorspace"></a><h3>gtk.gdk.Pixbuf.get_colorspace</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_colorspace</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the color space.</td></tr></tbody></table><p>The <tt class="methodname">get_colorspace</tt>() method returns the
color space of the pixbuf.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-n-channels"></a><h3>gtk.gdk.Pixbuf.get_n_channels</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_n_channels</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the number of channels.</td></tr></tbody></table><p>The <tt class="methodname">get_n_channels</tt>() method returns the
number of channels of a pixbuf.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-has-alpha"></a><h3>gtk.gdk.Pixbuf.get_has_alpha</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_has_alpha</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if the pixbuf has an
alpha channel.</td></tr></tbody></table><p>The <tt class="methodname">get_has_alpha</tt>() method returns
<tt class="literal">TRUE</tt> if the pixbuf has an alpha channel (opacity
information).</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-bits-per-sample"></a><h3>gtk.gdk.Pixbuf.get_bits_per_sample</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_bits_per_sample</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the number of bits per color
sample.</td></tr></tbody></table><p>The <tt class="methodname">get_bits_per_sample</tt>() method returns
the number of bits per color sample in a pixbuf.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-pixels"></a><h3>gtk.gdk.Pixbuf.get_pixels</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_pixels</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a string containing the pixel data of the
pixbuf</td></tr></tbody></table><p>The <tt class="methodname">get_pixels</tt>() method returns a sting
containing the pixel data of the pixbuf.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-width"></a><h3>gtk.gdk.Pixbuf.get_width</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_width</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the width in pixels.</td></tr></tbody></table><p>The <tt class="methodname">get_width</tt>() method returns the
width of the pixbuf.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-height"></a><h3>gtk.gdk.Pixbuf.get_height</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_height</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the height in pixels.</td></tr></tbody></table><p>The <tt class="methodname">get_height</tt>() method returns the
height of the pixbuf.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-rowstride"></a><h3>gtk.gdk.Pixbuf.get_rowstride</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_rowstride</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the number of bytes between
rows.</td></tr></tbody></table><p>The <tt class="methodname">get_rowstride</tt>() method returns the
rowstride of a pixbuf, which is the number of bytes between rows.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-option"></a><h3>gtk.gdk.Pixbuf.get_option</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_option</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>key</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>key</tt></b>:</span></td><td>a key string</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the value associated with
<i class="parameter"><tt>key</tt></i></td></tr></tbody></table><p>The <tt class="methodname">get_option</tt>() method looks up
<i class="parameter"><tt>key</tt></i> in the list of options that may have been
attached to the pixbuf when it was loaded.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--copy"></a><h3>gtk.gdk.Pixbuf.copy</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">copy</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>A newly-created pixbuf or
<tt class="literal">None</tt> if not enough memory could be
allocated.</td></tr></tbody></table><p>The <tt class="methodname">copy</tt>() method returns a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a> with
a copy of the data in the pixbuf.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--fill"></a><h3>gtk.gdk.Pixbuf.fill</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">fill</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>pixel</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>pixel</tt></b>:</span></td><td>the RGBA pixel to clear to (0xffffffff is
opaque white, 0x00000000 transparent black)</td></tr></tbody></table><p>The <tt class="methodname">fill</tt>() method clears the pixbuf to
the RGBA value specified by <i class="parameter"><tt>pixel</tt></i>, converting the
RGBA value into the pixbuf's pixel format. The alpha will be ignored if the
pixbuf doesn't have an alpha channel.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--save"></a><h3>gtk.gdk.Pixbuf.save</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">save</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filename</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>options</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>filename</tt></b>:</span></td><td>the name of file to save.</td></tr><tr><td><span class="term"><b class="parameter"><tt>type</tt></b>:</span></td><td>the name of the file
format.</td></tr><tr><td><span class="term"><b class="parameter"><tt>options</tt></b>:</span></td><td>a Python dict containing key-value string pairs
or <tt class="literal">None</tt></td></tr></tbody></table><p>The <tt class="methodname">save</tt>() method saves the pixbuf to a
file in the format specified by <i class="parameter"><tt>type</tt></i>, which may be
"jpeg" or "png". If <i class="parameter"><tt>options</tt></i> is not
<tt class="literal">None</tt> it should be a Python dict containing key-value
string pairs that modify the save parameters. For example:</p><div class="informalexample"><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
pixbuf.save(filename, "jpeg", {"quality":"100"})
</pre></td></tr></table></div><p>Currently only a few parameters exist. JPEG images can be saved
with a "quality" parameter; its value should be in the range [0,100]. Text
chunks can be attached to PNG images by specifying parameters of the form
"tEXt::key", where key is an ASCII string of length 1-79. The values are
UTF-8 encoded strings. Note however that PNG text chunks are stored in
ISO-8859-1 encoding, so you can only set texts that can be represented in
this encoding.</p><p>This method raises the GError exception if an error occurs
during the save operation.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--add-alpha"></a><h3>gtk.gdk.Pixbuf.add_alpha</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_alpha</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>substitute_color</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>r</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>g</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>b</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>substitute_color</tt></b>:</span></td><td>if <tt class="literal">FALSE</tt>, the
(<i class="parameter"><tt>r</tt></i>, <i class="parameter"><tt>g</tt></i>,
<i class="parameter"><tt>b</tt></i>) arguments will be ignored.</td></tr><tr><td><span class="term"><b class="parameter"><tt>r</tt></b>:</span></td><td>the red value to
substitute.</td></tr><tr><td><span class="term"><b class="parameter"><tt>g</tt></b>:</span></td><td>the green value to
substitute.</td></tr><tr><td><span class="term"><b class="parameter"><tt>b</tt></b>:</span></td><td>the blue value to
substitute.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>.</td></tr></tbody></table><p>The <tt class="methodname">add_alpha</tt>() method returns a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
created from the pixbuf with an alpha channel added. If the pixbuf already
had an alpha channel, the channel values are copied; otherwise, the alpha
channel is initialized to 255 (full opacity).</p><p>If <i class="parameter"><tt>substitute_color</tt></i> is
<tt class="literal">TRUE</tt>, then the color specified by
(<i class="parameter"><tt>r</tt></i>, <i class="parameter"><tt>g</tt></i>,
<i class="parameter"><tt>b</tt></i>) will be assigned zero opacity. That is, if you
pass (255, 255, 255) for the substitute color, all white pixels will become
fully transparent.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--copy-area"></a><h3>gtk.gdk.Pixbuf.copy_area</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">copy_area</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_pixbuf</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>src_x</tt></b>:</span></td><td>the X coordinate within the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_y</tt></b>:</span></td><td>the Y coordinate within the
pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>the width of the area to
copy.</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>the height of the area to
copy.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_pixbuf</tt></b>:</span></td><td>the destination pixbuf.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_x</tt></b>:</span></td><td>the X coordinate within
<i class="parameter"><tt>dest_pixbuf</tt></i>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_y</tt></b>:</span></td><td>the Y coordinate within
<i class="parameter"><tt>dest_pixbuf</tt></i>.</td></tr></tbody></table><p>The <tt class="methodname">copy_area</tt>() method copies a
rectangular area from the pixbuf to the destination <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
specified by <i class="parameter"><tt>dest_pixbuf</tt></i>. Conversion of pixbuf
formats is done automatically.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--saturate-and-pixelate"></a><h3>gtk.gdk.Pixbuf.saturate_and_pixelate</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">saturate_and_pixelate</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>saturation</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>pixelate</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>dest</tt></b>:</span></td><td>the <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a> to
write the modified version of the pixbuf</td></tr><tr><td><span class="term"><b class="parameter"><tt>saturation</tt></b>:</span></td><td>the saturation factor</td></tr><tr><td><span class="term"><b class="parameter"><tt>pixelate</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> pixelate
<i class="parameter"><tt>dest</tt></i></td></tr></tbody></table><p>The <tt class="methodname">saturate_and_pixelate</tt>() method
modifies the saturation and optionally pixelates the pixbuf, placing the
result in <i class="parameter"><tt>dest</tt></i>. the pixbuf and
<i class="parameter"><tt>dest</tt></i> may be the same <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a> with
no ill effects. If <i class="parameter"><tt>saturation</tt></i> is 1.0 then saturation
is not changed. If it's less than 1.0, saturation is reduced (the image is
darkened); if greater than 1.0, saturation is increased (the image is
brightened). If <i class="parameter"><tt>pixelate</tt></i> is <tt class="literal">TRUE</tt>,
then pixels are faded in a checkerboard pattern to create a pixelated image.
The pixbuf and <i class="parameter"><tt>dest</tt></i> must have the same image format,
size, and rowstride.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--scale"></a><h3>gtk.gdk.Pixbuf.scale</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">scale</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>dest</tt></b>:</span></td><td>the <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a> the
scaling is rendered to.</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_x</tt></b>:</span></td><td>the X coordinate for the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_y</tt></b>:</span></td><td>the Y coordinate for the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_width</tt></b>:</span></td><td>the width of the rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_height</tt></b>:</span></td><td>the height of the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>offset_x</tt></b>:</span></td><td>the offset in the X direction (currently
rounded to an integer)</td></tr><tr><td><span class="term"><b class="parameter"><tt>offset_y</tt></b>:</span></td><td>the offset in the Y direction (currently
rounded to an integer)</td></tr><tr><td><span class="term"><b class="parameter"><tt>scale_x</tt></b>:</span></td><td>the scale factor in the X
direction</td></tr><tr><td><span class="term"><b class="parameter"><tt>scale_y</tt></b>:</span></td><td>the scale factor in the Y
direction</td></tr><tr><td><span class="term"><b class="parameter"><tt>interp_type</tt></b>:</span></td><td>the interpolation type for the
transformation.</td></tr></tbody></table><p>The <tt class="methodname">scale</tt>() method creates a
transformation of the pixbuf's image by scaling by
<i class="parameter"><tt>scale_x</tt></i> and <i class="parameter"><tt>scale_y</tt></i> and
translating by <i class="parameter"><tt>offset_x</tt></i> and
<i class="parameter"><tt>offset_y</tt></i> it, then rendering the rectangle
(<i class="parameter"><tt>dest_x</tt></i>, <i class="parameter"><tt>dest_y</tt></i>,
<i class="parameter"><tt>dest_width</tt></i>, <i class="parameter"><tt>dest_height</tt></i>) of
the resulting image onto the destination image specified by
<i class="parameter"><tt>dest</tt></i> replacing the previous contents. The value of
<i class="parameter"><tt>interp_type</tt></i> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_NEAREST</tt></span></td><td>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_TILES</tt></span></td><td>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_BILINEAR</tt></span></td><td>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_HYPER</tt></span></td><td>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</td></tr></tbody></table><p>Try the <a href="class-gdkpixbuf.html#method-gdkpixbuf--scale-simple" title="gtk.gdk.Pixbuf.scale_simple"><tt class="methodname">scale_simple</tt>()</a>
method as an alternative with a simpler interface.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--composite"></a><h3>gtk.gdk.Pixbuf.composite</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">composite</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>overall_alpha</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>dest</tt></b>:</span></td><td>the output <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_x</tt></b>:</span></td><td>the X coordinate for the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_y</tt></b>:</span></td><td>the top coordinate for the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_width</tt></b>:</span></td><td>the width of the rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_height</tt></b>:</span></td><td>the height of the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>offset_x</tt></b>:</span></td><td>the offset in the X direction (currently
rounded to an integer)</td></tr><tr><td><span class="term"><b class="parameter"><tt>offset_y</tt></b>:</span></td><td>the offset in the Y direction (currently
rounded to an integer)</td></tr><tr><td><span class="term"><b class="parameter"><tt>scale_x</tt></b>:</span></td><td>the scale factor in the X
direction</td></tr><tr><td><span class="term"><b class="parameter"><tt>scale_y</tt></b>:</span></td><td>the scale factor in the Y
direction</td></tr><tr><td><span class="term"><b class="parameter"><tt>interp_type</tt></b>:</span></td><td>the interpolation type for the
transformation.</td></tr><tr><td><span class="term"><b class="parameter"><tt>overall_alpha</tt></b>:</span></td><td>overall alpha for source image
(0..255)</td></tr></tbody></table><p>The <tt class="methodname">composite</tt>() method creates a
transformation of the pixbuf's image by scaling by
<i class="parameter"><tt>scale_x</tt></i> and <i class="parameter"><tt>scale_y</tt></i> and
translating by <i class="parameter"><tt>offset_x</tt></i> and
<i class="parameter"><tt>offset_y</tt></i>, then compositing the rectangle
(<i class="parameter"><tt>dest_x</tt></i>, <i class="parameter"><tt>dest_y</tt></i>,
<i class="parameter"><tt>dest_width</tt></i>, <i class="parameter"><tt>dest_height</tt></i>) of
the resulting image onto the destination image. The value of
<i class="parameter"><tt>interp_type</tt></i> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_NEAREST</tt></span></td><td>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_TILES</tt></span></td><td>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_BILINEAR</tt></span></td><td>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_HYPER</tt></span></td><td>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</td></tr></tbody></table><p></p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--composite-color"></a><h3>gtk.gdk.Pixbuf.composite_color</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">composite_color</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>offset_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>scale_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>overall_alpha</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>check_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>check_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>check_size</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>color1</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>color2</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>dest</tt></b>:</span></td><td>the output <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_x</tt></b>:</span></td><td>the X coordinate for the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_y</tt></b>:</span></td><td>the top coordinate for the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_width</tt></b>:</span></td><td>the width of the rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_height</tt></b>:</span></td><td>the height of the
rectangle</td></tr><tr><td><span class="term"><b class="parameter"><tt>offset_x</tt></b>:</span></td><td>the offset in the X direction (currently
rounded to an integer)</td></tr><tr><td><span class="term"><b class="parameter"><tt>offset_y</tt></b>:</span></td><td>the offset in the Y direction (currently
rounded to an integer)</td></tr><tr><td><span class="term"><b class="parameter"><tt>scale_x</tt></b>:</span></td><td>the scale factor in the X
direction</td></tr><tr><td><span class="term"><b class="parameter"><tt>scale_y</tt></b>:</span></td><td>the scale factor in the Y
direction</td></tr><tr><td><span class="term"><b class="parameter"><tt>interp_type</tt></b>:</span></td><td>the interpolation type for the
transformation.</td></tr><tr><td><span class="term"><b class="parameter"><tt>overall_alpha</tt></b>:</span></td><td>overall alpha for source image
(0..255)</td></tr><tr><td><span class="term"><b class="parameter"><tt>check_x</tt></b>:</span></td><td>the X offset for the checkboard (origin of
checkboard is at -<i class="parameter"><tt>check_x</tt></i>,
-<i class="parameter"><tt>check_y</tt></i>)</td></tr><tr><td><span class="term"><b class="parameter"><tt>check_y</tt></b>:</span></td><td>the Y offset for the
checkboard</td></tr><tr><td><span class="term"><b class="parameter"><tt>check_size</tt></b>:</span></td><td>the size of checks in the checkboard (must be a
power of two)</td></tr><tr><td><span class="term"><b class="parameter"><tt>color1</tt></b>:</span></td><td>the color of check at upper
left</td></tr><tr><td><span class="term"><b class="parameter"><tt>color2</tt></b>:</span></td><td>the color of the other
check</td></tr></tbody></table><p>The <tt class="methodname">composite_color</tt>() method creates a
transformation of the source image <i class="parameter"><tt>src</tt></i> by scaling by
<i class="parameter"><tt>scale_x</tt></i> and <i class="parameter"><tt>scale_y</tt></i> and
translating by <i class="parameter"><tt>offset_x</tt></i> and
<i class="parameter"><tt>offset_y</tt></i>, then compositing the rectangle
(<i class="parameter"><tt>dest_x</tt></i> ,<i class="parameter"><tt>dest_y</tt></i>,
<i class="parameter"><tt>dest_width</tt></i>, <i class="parameter"><tt>dest_height</tt></i>) of
the resulting image with a checkboard of the colors
<i class="parameter"><tt>color1</tt></i> and <i class="parameter"><tt>color2</tt></i> and renders
it onto the destination image. The value of
<i class="parameter"><tt>interp_type</tt></i> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_NEAREST</tt></span></td><td>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_TILES</tt></span></td><td>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_BILINEAR</tt></span></td><td>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_HYPER</tt></span></td><td>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</td></tr></tbody></table><p>See the <a href="class-gdkpixbuf.html#method-gdkpixbuf--composite-color-simple" title="gtk.gdk.Pixbuf.composite_color_simple"><tt class="methodname">composite_color_simple</tt>()</a>
method for a simpler variant of this method suitable for most tasks.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--scale-simple"></a><h3>gtk.gdk.Pixbuf.scale_simple</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">scale_simple</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>dest_width</tt></b>:</span></td><td>the width of destination
image</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_height</tt></b>:</span></td><td>the height of destination
image</td></tr><tr><td><span class="term"><b class="parameter"><tt>interp_type</tt></b>:</span></td><td>the interpolation type for the
transformation.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>, or
<tt class="literal">None</tt> if not enough memory could be allocated for
it.</td></tr></tbody></table><p>The <tt class="methodname">scale_simple</tt>() method returns a new
<a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
containing a copy of the pixbuf scaled to <i class="parameter"><tt>dest_width</tt></i>
x <i class="parameter"><tt>dest_height</tt></i>. The pixbuf is unaffected by the
scaling operation. The value of <i class="parameter"><tt>interp_type</tt></i> must be
one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_NEAREST</tt></span></td><td>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_TILES</tt></span></td><td>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_BILINEAR</tt></span></td><td>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_HYPER</tt></span></td><td>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</td></tr></tbody></table><p><i class="parameter"><tt>interp_type</tt></i> should be
<tt class="literal">gtk.gdk.INTERP_NEAREST</tt> if you want maximum speed (but
when scaling down <tt class="literal">gtk.gdk.INTERP_NEAREST</tt> is usually
unusably ugly). The default <i class="parameter"><tt>interp_type</tt></i> should be
<tt class="literal">GDK_INTERP_BILINEAR</tt> which offers reasonable quality and
speed.</p><p>You can scale a sub-portion of <i class="parameter"><tt>src</tt></i> by
creating a sub-pixbuf pointing into <i class="parameter"><tt>src</tt></i>; see the
<a href="class-gdkpixbuf.html#method-gdkpixbuf--subpixbuf" title="gtk.gdk.Pixbuf.subpixbuf"><tt class="methodname">subpixbuf</tt>()</a>
method for more information.</p><p>For more complicated scaling/compositing see the <a href="class-gdkpixbuf.html#method-gdkpixbuf--scale" title="gtk.gdk.Pixbuf.scale"><tt class="methodname">scale</tt>()</a>
and <a href="class-gdkpixbuf.html#method-gdkpixbuf--composite" title="gtk.gdk.Pixbuf.composite"><tt class="methodname">composite</tt>()</a>
methods.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--composite-color-simple"></a><h3>gtk.gdk.Pixbuf.composite_color_simple</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">composite_color_simple</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>dest_height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>interp_type</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>overall_alpha</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>check_size</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>color1</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>color2</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>dest_width</tt></b>:</span></td><td>the width of destination
image</td></tr><tr><td><span class="term"><b class="parameter"><tt>dest_height</tt></b>:</span></td><td>the height of destination
image</td></tr><tr><td><span class="term"><b class="parameter"><tt>interp_type</tt></b>:</span></td><td>the interpolation type for the
transformation.</td></tr><tr><td><span class="term"><b class="parameter"><tt>overall_alpha</tt></b>:</span></td><td>overall alpha for source image
(0..255)</td></tr><tr><td><span class="term"><b class="parameter"><tt>check_size</tt></b>:</span></td><td>the size of checks in the checkboard (must be a
power of two)</td></tr><tr><td><span class="term"><b class="parameter"><tt>color1</tt></b>:</span></td><td>the color of check at upper
left</td></tr><tr><td><span class="term"><b class="parameter"><tt>color2</tt></b>:</span></td><td>the color of the other
check</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>, or
<tt class="literal">NULL</tt> if not enough memory could be allocated for
it.</td></tr></tbody></table><p>The <tt class="methodname">composite_color_simple</tt>() method
returns a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a> by
scaling the pixbuf to <i class="parameter"><tt>dest_width</tt></i> x
<i class="parameter"><tt>dest_height</tt></i> and compositing the result with a
checkboard of colors <i class="parameter"><tt>color1</tt></i> and
<i class="parameter"><tt>color2</tt></i>. The value of <i class="parameter"><tt>interp_type</tt></i> must be
one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_NEAREST</tt></span></td><td>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_TILES</tt></span></td><td>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_BILINEAR</tt></span></td><td>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</td></tr><tr><td><span class="term"><tt class="literal">gtk.gdk.INTERP_HYPER</tt></span></td><td>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</td></tr></tbody></table><p>See the <a href="class-gdkpixbuf.html#method-gdkpixbuf--composite-color" title="gtk.gdk.Pixbuf.composite_color"><tt class="methodname">composite_color</tt>()</a>
method for a more powerful but complicated interface.</p></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--get-pixels-array"></a><h3>gtk.gdk.Pixbuf.get_pixels_array</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_pixels_array</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a Numeric Python array containing the pixel
data of the pixbuf</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.2 and above.</p></div><p>The <tt class="methodname">get_pixels_array</tt>() method returns a
Numeric Python array containing the pixel data of the pixbuf.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>PyGTK must be compiled with Numeric Python support for this
method to be available.</p></div></div><div class="refsect2" lang="en"><a name="method-gdkpixbuf--subpixbuf"></a><h3>gtk.gdk.Pixbuf.subpixbuf</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">subpixbuf</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_x</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>src_y</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>src_x</tt></b>:</span></td><td>X coord in the pixbuf</td></tr><tr><td><span class="term"><b class="parameter"><tt>src_y</tt></b>:</span></td><td>Y coord in the pixbuf</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>width of region in the pixbuf</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>height of region in the pixbuf</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">subpixbuf</tt>() method creates a new
<a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
that represents a sub-region of the pixbuf. The new pixbuf shares its pixels
with the original pixbuf, so writing to one affects both.</p></div></div><div class="refsect1" lang="en"><a name="id3224825"></a><h2>Functions</h2><div class="refsect2" lang="en"><a name="function-gdk--pixbuf-new-from-file"></a><h3>gtk.gdk.pixbuf_new_from_file</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.pixbuf_new_from_file</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filename</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>filename</tt></b>:</span></td><td>the name of the file containing the image to
load</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>.</td></tr></tbody></table><p>The <tt class="function">gtk.gdk.pixbuf_new_from_file</tt>() function
returns a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
containing an image loaded from the file specified by
<i class="parameter"><tt>filename</tt></i>. The image file format is detected
automatically. The application will block until the image is done loading.
This method can be used by applications in which blocking is acceptable
while an image is being loaded (small images in general). Applications that
need progressive loading should use <a href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><tt class="classname">gtk.gdk.PixbufLoader</tt></a>
instead.</p><p>This function raises the GError exception if an error occurs
during the loading of the pixbuf.</p></div><div class="refsect2" lang="en"><a name="function-gdk--pixbuf-new-from-file-at-size"></a><h3>gtk.gdk.pixbuf_new_from_file_at_size</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.pixbuf_new_from_file_at_size</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filename</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>filename</tt></b>:</span></td><td>the name of the file containing the image to
load</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td> The width the image should
have</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td> The height the image should
have</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.4 and above.</p></div><p>The <tt class="function">gtk.gdk.pixbuf_new_from_file_at_size</tt>()
function returns a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
containing an image loaded from the file specified by
<i class="parameter"><tt>filename</tt></i> with it scaled to the size specified by
<i class="parameter"><tt>width</tt></i> and <i class="parameter"><tt>height</tt></i>. The image
file format is detected automatically. The application will block until the
image is done loading. This function can be used by applications in which
blocking is acceptable while an image is being loaded (small images in
general). Applications that need progressive loading should use a <a href="class-gdkpixbufloader.html" title="gtk.gdk.PixbufLoader"><tt class="classname">gtk.gdk.PixbufLoader</tt></a>
instead.</p><p>This function raises the GError exception if an error occurs
during the loading of the pixbuf.</p></div><div class="refsect2" lang="en"><a name="function-gdk--pixbuf-new-from-data"></a><h3>gtk.gdk.pixbuf_new_from_data</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.pixbuf_new_from_data</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>colorspace</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>has_alpha</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>bits_per_sample</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>width</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>height</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>rowstride</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>data</tt></b>:</span></td><td>a string containing image data in 8-bit/sample
packed format.</td></tr><tr><td><span class="term"><b class="parameter"><tt>colorspace</tt></b>:</span></td><td>the colorspace for the image
data.</td></tr><tr><td><span class="term"><b class="parameter"><tt>has_alpha</tt></b>:</span></td><td>If <tt class="literal">TRUE</tt>, the data has an
opacity channel.</td></tr><tr><td><span class="term"><b class="parameter"><tt>bits_per_sample</tt></b>:</span></td><td>the number of bits per
sample.</td></tr><tr><td><span class="term"><b class="parameter"><tt>width</tt></b>:</span></td><td>the width of the image in pixels.</td></tr><tr><td><span class="term"><b class="parameter"><tt>height</tt></b>:</span></td><td>the height of the image in pixels.</td></tr><tr><td><span class="term"><b class="parameter"><tt>rowstride</tt></b>:</span></td><td>the distance in bytes between row
starts.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.2 and above.</p></div><p>The <tt class="function">gtk.gdk.pixbuf_new_from_data</tt>() function
returns a new pixbuf created from the string specified by
<i class="parameter"><tt>data</tt></i>. <i class="parameter"><tt>data</tt></i> must be RGB image
data with 8 bits per sample. <i class="parameter"><tt>colorspace</tt></i> must be
<tt class="literal">gtk.gdk.COLORSPACE_RGB</tt>.</p></div><div class="refsect2" lang="en"><a name="function-gdk--pixbuf-new-from-array"></a><h3>gtk.gdk.pixbuf_new_from_array</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.pixbuf_new_from_array</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>array</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>colorspace</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>bits_per_sample</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>array</tt></b>:</span></td><td>a string containing image data in 8-bit/sample
packed format.</td></tr><tr><td><span class="term"><b class="parameter"><tt>colorspace</tt></b>:</span></td><td>the colorspace for the image
data.</td></tr><tr><td><span class="term"><b class="parameter"><tt>bits_per_sample</tt></b>:</span></td><td>the number of bits per
sample.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.2 and above.</p></div><p>The <tt class="function">gtk.gdk.pixbuf_new_from_array</tt>()
function returns a new pixbuf created from the Numeric Python array
specified by <i class="parameter"><tt>array</tt></i>. <i class="parameter"><tt>array</tt></i> must
be a 3 or 4 dimensional array (4 if the image has an alpha channel) with
<i class="parameter"><tt>bits_per_sample</tt></i> bits per sample.
<i class="parameter"><tt>colorspace</tt></i> must be
<tt class="literal">gtk.gdk.COLORSPACE_RGB</tt>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>PyGTK must be compiled with the Numeric Python module to
support this function.</p></div></div><div class="refsect2" lang="en"><a name="function-gdk--pixbuf-new-from-xpm-data"></a><h3>gtk.gdk.pixbuf_new_from_xpm_data</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.pixbuf_new_from_xpm_data</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>data</tt></b>:</span></td><td>a list of strings containing the XPM image
data</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a></td></tr></tbody></table><p>The <tt class="function">gtk.gdk.pixbuf_new_from_xpm_data</tt>()
function returns a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a> by
parsing <tt class="literal">XPM</tt> data in memory specified by
<i class="parameter"><tt>data</tt></i>. <i class="parameter"><tt>data</tt></i> is a list of
strings containing the <tt class="literal">XPM</tt> data.</p></div><div class="refsect2" lang="en"><a name="function-gdk--pixbuf-new-from-inline"></a><h3>gtk.gdk.pixbuf_new_from_inline</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.pixbuf_new_from_inline</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>data_length</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>copy_pixels</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>data_length</tt></b>:</span></td><td>the length in bytes of the
<i class="parameter"><tt>data</tt></i></td></tr><tr><td><span class="term"><b class="parameter"><tt>data</tt></b>:</span></td><td>a string containing the inline pixbuf
data</td></tr><tr><td><span class="term"><b class="parameter"><tt>copy_pixels</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> the pixel data
should be copied</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
object</td></tr></tbody></table><p>The <tt class="function">gtk.gdk.pixbuf_new_from_inline</tt>()
function returns a <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a> from
a flat representation that is suitable for storing as inline data in a
program. This is useful if you want to ship a program with images, but don't
want to depend on any external files.</p><p>GTK+ ships with a program called
<span><b class="command">gdk-pixbuf-csource</b></span> which allows for conversion of an
image into such a inline representation.In almost all cases, you should pass
the <tt class="option">--raw</tt> flag to <span><b class="command">gdk-pixbuf-csource</b></span>. A
sample invocation would be:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
gdk-pixbuf-csource --raw --name=myimage_inline myimage.png
</pre></td></tr></table><p>For the typical case where the inline pixbuf is read-only static
data, you don't need to copy the pixel data unless you intend to write to
it, so you can pass <tt class="literal">FALSE</tt> for
<i class="parameter"><tt>copy_pixels</tt></i>.</p><p>This function raises the GError exception if an error occurs
during the loading of the pixbuf.</p></div><div class="refsect2" lang="en"><a name="function-gdk--pixbuf-get-formats"></a><h3>gtk.gdk.pixbuf_get_formats</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.pixbuf_get_formats</span>()</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a list of image formats as Python
dicts</td></tr></tbody></table><p>The <tt class="function">gtk.gdk.pixbuf_get_formats</tt>() function
returns a list of the supported image formats as a Python dict. The keys
of the image format dict are:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>name</tt></i>:</span></td><td>the name of the image format.</td></tr><tr><td><span class="term"><i class="parameter"><tt>description</tt></i>:</span></td><td>a description of the image
format.</td></tr><tr><td><span class="term"><i class="parameter"><tt>mime_types</tt></i>:</span></td><td>a list of the mime types this image
matches.</td></tr><tr><td><span class="term"><i class="parameter"><tt>extensions</tt></i>:</span></td><td>a list of typical filename extensions for the
image format.</td></tr><tr><td><span class="term"><i class="parameter"><tt>is_writable</tt></i>:</span></td><td>if <tt class="literal">TRUE</tt> the image can be
written to a file</td></tr></tbody></table></div><div class="refsect2" lang="en"><a name="function-gdk--pixbuf-get-file-info"></a><h3>gtk.gdk.pixbuf_get_file_info</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.gdk.pixbuf_get_file_info</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filename</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>filename</tt></b>:</span></td><td>the name of the file to check</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>an image format as a Python dict</td></tr></tbody></table><p>The <tt class="function">gtk.gdk.pixbuf_get_file_info</tt>() function
reads enough of the file specified by <i class="parameter"><tt>filename</tt></i> to
determine its image format and then returns the image format information in
a Python dict. See the <a href="class-gdkpixbuf.html#function-gdk--pixbuf-get-formats" title="gtk.gdk.pixbuf_get_formats"><tt class="function">gtk.gdk.pixbuf_get_formats</tt>()</a>
function for more details on the image format dict.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gdkkeymap.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gdk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gdkpixbufanimation.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.gdk.Keymap</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.gdk.PixbufAnimation</td></tr></table></div></body></html>
|