File: gdk-Images.html

package info (click to toggle)
gtk%2B2.0 2.20.1-2%2Bdeb6u2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 136,284 kB
  • ctags: 66,487
  • sloc: ansic: 590,318; sh: 10,559; makefile: 5,573; xml: 1,357; python: 866; perl: 776; asm: 457; awk: 72; cpp: 34
file content (602 lines) | stat: -rw-r--r-- 38,945 bytes parent folder | download | duplicates (2)
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
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Images</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk-GdkRGB.html" title="GdkRGB">
<link rel="next" href="gdk-Pixbufs.html" title="Pixbufs">
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-GdkRGB.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK Reference Manual</th>
<td><a accesskey="n" href="gdk-Pixbufs.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk-Images.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gdk-Images.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Images">
<a name="gdk-Images"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-Images.top_of_page"></a>Images</span></h2>
<p>Images — A client-side area for bit-mapped graphics</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="gdk-Images.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gdk/gdk.h&gt;

                    <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a>;
<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="returnvalue">GdkImage</span></a>*           <a class="link" href="gdk-Images.html#gdk-image-new" title="gdk_image_new ()">gdk_image_new</a>                       (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImageType" title="enum GdkImageType"><span class="type">GdkImageType</span></a> type</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> *visual</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>);
enum                <a class="link" href="gdk-Images.html#GdkImageType" title="enum GdkImageType">GdkImageType</a>;
<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="returnvalue">GdkImage</span></a>*           <a class="link" href="gdk-Images.html#gdk-image-new-bitmap" title="gdk_image_new_bitmap ()">gdk_image_new_bitmap</a>                (<em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> *visual</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>);
<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="returnvalue">GdkImage</span></a>*           <a class="link" href="gdk-Images.html#gdk-image-get" title="gdk_image_get ()">gdk_image_get</a>                       (<em class="parameter"><code><a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>);
<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="returnvalue">GdkImage</span></a> *          <a class="link" href="gdk-Images.html#gdk-image-ref" title="gdk_image_ref ()">gdk_image_ref</a>                       (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-Images.html#gdk-image-unref" title="gdk_image_unref ()">gdk_image_unref</a>                     (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>);
#define             <a class="link" href="gdk-Images.html#gdk-image-destroy" title="gdk_image_destroy">gdk_image_destroy</a>
<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="returnvalue">GdkColormap</span></a>*        <a class="link" href="gdk-Images.html#gdk-image-get-colormap" title="gdk_image_get_colormap ()">gdk_image_get_colormap</a>              (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-Images.html#gdk-image-set-colormap" title="gdk_image_set_colormap ()">gdk_image_set_colormap</a>              (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>);

<span class="returnvalue">void</span>                <a class="link" href="gdk-Images.html#gdk-image-put-pixel" title="gdk_image_put_pixel ()">gdk_image_put_pixel</a>                 (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> pixel</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             <a class="link" href="gdk-Images.html#gdk-image-get-pixel" title="gdk_image_get_pixel ()">gdk_image_get_pixel</a>                 (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="gdk-Images.description"></a><h2>Description</h2>
<p>
The <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> type represents an area for drawing graphics.
It has now been superceded to a large extent by the much more flexible
<a class="link" href="gdk-GdkRGB.html" title="GdkRGB">GdkRGB</a> functions.
</p>
<p>
To create an empty <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> use <a class="link" href="gdk-Images.html#gdk-image-new" title="gdk_image_new ()"><code class="function">gdk_image_new()</code></a>.
To create a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> from bitmap data use <a class="link" href="gdk-Images.html#gdk-image-new-bitmap" title="gdk_image_new_bitmap ()"><code class="function">gdk_image_new_bitmap()</code></a>.
To create an image from part of a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> use <a class="link" href="gdk-Drawing-Primitives.html#gdk-drawable-get-image" title="gdk_drawable_get_image ()"><code class="function">gdk_drawable_get_image()</code></a>.
</p>
<p>
The image can be manipulated with <a class="link" href="gdk-Images.html#gdk-image-get-pixel" title="gdk_image_get_pixel ()"><code class="function">gdk_image_get_pixel()</code></a> and
<a class="link" href="gdk-Images.html#gdk-image-put-pixel" title="gdk_image_put_pixel ()"><code class="function">gdk_image_put_pixel()</code></a>, or alternatively by changing the actual pixel data.
Though manipulating the pixel data requires complicated code to cope with
the different formats that may be used.
</p>
<p>
To draw a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> in a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> or <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a> use <a class="link" href="gdk-Drawing-Primitives.html#gdk-draw-image" title="gdk_draw_image ()"><code class="function">gdk_draw_image()</code></a>.
</p>
<p>
To destroy a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> use <a class="link" href="gdk-Images.html#gdk-image-destroy" title="gdk_image_destroy"><code class="function">gdk_image_destroy()</code></a>.
</p>
</div>
<div class="refsect1" title="Details">
<a name="gdk-Images.details"></a><h2>Details</h2>
<div class="refsect2" title="GdkImage">
<a name="GdkImage"></a><h3>GdkImage</h3>
<pre class="programlisting">typedef struct {
  GObject parent_instance;

  
  GdkImageType type; /* read only. */
  GdkVisual    *visual;	    /* read only. visual used to create the image */
  GdkByteOrder byte_order; /* read only. */
  gint		width; /* read only. */
  gint		height; /* read only. */
  guint16 depth; /* read only. */
  guint16 bpp;	        /* read only. bytes per pixel */
  guint16 bpl;	        /* read only. bytes per line */
  guint16       bits_per_pixel; /* read only. bits per pixel */
  gpointer mem;

  GdkColormap  *colormap; /* read only. */
} GdkImage;
</pre>
<p>
The <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> struct contains information on the image and the pixel data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> <em class="structfield"><code><a name="GdkImage.parent-instance"></a>parent_instance</code></em>;</span></p></td>
<td>the parent instance
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Images.html#GdkImageType" title="enum GdkImageType"><span class="type">GdkImageType</span></a> <em class="structfield"><code><a name="GdkImage.type"></a>type</code></em>;</span></p></td>
<td>the type of the image.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> *<em class="structfield"><code><a name="GdkImage.visual"></a>visual</code></em>;</span></p></td>
<td>the visual.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Visuals.html#GdkByteOrder" title="enum GdkByteOrder"><span class="type">GdkByteOrder</span></a> <em class="structfield"><code><a name="GdkImage.byte-order"></a>byte_order</code></em>;</span></p></td>
<td>the byte order.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkImage.width"></a>width</code></em>;</span></p></td>
<td>the width of the image in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkImage.height"></a>height</code></em>;</span></p></td>
<td>the height of the image in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GdkImage.depth"></a>depth</code></em>;</span></p></td>
<td>the depth of the image, i.e. the number of bits per pixel.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GdkImage.bpp"></a>bpp</code></em>;</span></p></td>
<td>the number of bytes per pixel.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GdkImage.bpl"></a>bpl</code></em>;</span></p></td>
<td>the number of bytes per line of the image.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> <em class="structfield"><code><a name="GdkImage.bits-per-pixel"></a>bits_per_pixel</code></em>;</span></p></td>
<td>the number of bits per pixel.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="GdkImage.mem"></a>mem</code></em>;</span></p></td>
<td>the pixel data.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *<em class="structfield"><code><a name="GdkImage.colormap"></a>colormap</code></em>;</span></p></td>
<td>the <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> associated with the image
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_image_new ()">
<a name="gdk-image-new"></a><h3>gdk_image_new ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="returnvalue">GdkImage</span></a>*           gdk_image_new                       (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImageType" title="enum GdkImageType"><span class="type">GdkImageType</span></a> type</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> *visual</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>);</pre>
<p>
Creates a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the type of the <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, one of <a class="link" href="gdk-Images.html#GDK-IMAGE-NORMAL:CAPS"><code class="literal">GDK_IMAGE_NORMAL</code></a>, <a class="link" href="gdk-Images.html#GDK-IMAGE-SHARED:CAPS"><code class="literal">GDK_IMAGE_SHARED</code></a>
and <a class="link" href="gdk-Images.html#GDK-IMAGE-FASTEST:CAPS"><code class="literal">GDK_IMAGE_FASTEST</code></a>. <a class="link" href="gdk-Images.html#GDK-IMAGE-FASTEST:CAPS"><code class="literal">GDK_IMAGE_FASTEST</code></a> is probably the best choice, since
it will try creating a <a class="link" href="gdk-Images.html#GDK-IMAGE-SHARED:CAPS"><code class="literal">GDK_IMAGE_SHARED</code></a> image first and if that fails it will
then use <a class="link" href="gdk-Images.html#GDK-IMAGE-NORMAL:CAPS"><code class="literal">GDK_IMAGE_NORMAL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>visual</code></em> :</span></p></td>
<td>the <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> to use for the image.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td>the width of the image in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td>the height of the image in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the image could not be created.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum GdkImageType">
<a name="GdkImageType"></a><h3>enum GdkImageType</h3>
<pre class="programlisting">typedef enum
{
  GDK_IMAGE_NORMAL,
  GDK_IMAGE_SHARED,
  GDK_IMAGE_FASTEST
} GdkImageType;
</pre>
<p>
Specifies the type of a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GDK-IMAGE-NORMAL:CAPS"></a><span class="term"><code class="literal">GDK_IMAGE_NORMAL</code></span></p></td>
<td>The original X image type, which is quite slow since the
image has to be transferred from the client to the server to display it.
</td>
</tr>
<tr>
<td><p><a name="GDK-IMAGE-SHARED:CAPS"></a><span class="term"><code class="literal">GDK_IMAGE_SHARED</code></span></p></td>
<td>A faster image type, which uses shared memory to transfer
the image data between client and server. However this will only be available
if client and server are on the same machine and the shared memory extension
is supported by the server.
</td>
</tr>
<tr>
<td><p><a name="GDK-IMAGE-FASTEST:CAPS"></a><span class="term"><code class="literal">GDK_IMAGE_FASTEST</code></span></p></td>
<td>Specifies that <a class="link" href="gdk-Images.html#GDK-IMAGE-SHARED:CAPS"><code class="literal">GDK_IMAGE_SHARED</code></a> should be tried first,
and if that fails then <a class="link" href="gdk-Images.html#GDK-IMAGE-NORMAL:CAPS"><code class="literal">GDK_IMAGE_NORMAL</code></a> will be used.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_image_new_bitmap ()">
<a name="gdk-image-new-bitmap"></a><h3>gdk_image_new_bitmap ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="returnvalue">GdkImage</span></a>*           gdk_image_new_bitmap                (<em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> *visual</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_new_bitmap</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Creates a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> with a depth of 1 from the given data.
</p>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p>THIS FUNCTION IS INCREDIBLY BROKEN. The passed-in data must 
be allocated by <code class="function">malloc()</code> (NOT <a href="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-malloc"><code class="function">g_malloc()</code></a>) and will be freed when the 
image is freed.</p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>visual</code></em> :</span></p></td>
<td>the <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> to use for the image.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the pixel data. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td>the width of the image in pixels. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td>the height of the image in pixels. 
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_image_get ()">
<a name="gdk-image-get"></a><h3>gdk_image_get ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="returnvalue">GdkImage</span></a>*           gdk_image_get                       (<em class="parameter"><code><a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_get</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
This is a deprecated wrapper for <a class="link" href="gdk-Drawing-Primitives.html#gdk-drawable-get-image" title="gdk_drawable_get_image ()"><code class="function">gdk_drawable_get_image()</code></a>;
<a class="link" href="gdk-Drawing-Primitives.html#gdk-drawable-get-image" title="gdk_drawable_get_image ()"><code class="function">gdk_drawable_get_image()</code></a> should be used instead. Or even better: in
most cases <a class="link" href="gdk-Pixbufs.html#gdk-pixbuf-get-from-drawable" title="gdk_pixbuf_get_from_drawable ()"><code class="function">gdk_pixbuf_get_from_drawable()</code></a> is the most convenient
choice.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>x coordinate in <em class="parameter"><code>window</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td>y coordinate in <em class="parameter"><code>window</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td>width of area in <em class="parameter"><code>window</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td>height of area in <em class="parameter"><code>window</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_image_ref ()">
<a name="gdk-image-ref"></a><h3>gdk_image_ref ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="returnvalue">GdkImage</span></a> *          gdk_image_ref                       (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_ref</code> has been deprecated since version 2.0 and should not be used in newly-written code. Use <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a> instead.</p>
</div>
<p>
Deprecated function; use <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a> instead.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the image

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_image_unref ()">
<a name="gdk-image-unref"></a><h3>gdk_image_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_image_unref                     (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_unref</code> has been deprecated since version 2.0 and should not be used in newly-written code. Use <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> instead.</p>
</div>
<p>
Deprecated function; use <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> instead.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_image_destroy">
<a name="gdk-image-destroy"></a><h3>gdk_image_destroy</h3>
<pre class="programlisting">#define gdk_image_destroy              g_object_unref
</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_destroy</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Destroys a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, freeing any resources allocated for it.
</p>
</div>
<hr>
<div class="refsect2" title="gdk_image_get_colormap ()">
<a name="gdk-image-get-colormap"></a><h3>gdk_image_get_colormap ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="returnvalue">GdkColormap</span></a>*        gdk_image_get_colormap              (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>);</pre>
<p>
Retrieves the colormap for a given image, if it exists.  An image
will have a colormap if the drawable from which it was created has
a colormap, or if a colormap was set explicitely with
<a class="link" href="gdk-Images.html#gdk-image-set-colormap" title="gdk_image_set_colormap ()"><code class="function">gdk_image_set_colormap()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> colormap for the image
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_image_set_colormap ()">
<a name="gdk-image-set-colormap"></a><h3>gdk_image_set_colormap ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_image_set_colormap              (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>);</pre>
<p>
Sets the colormap for the image to the given colormap.  Normally
there's no need to use this function, images are created with the
correct colormap if you get the image from a drawable. If you
create the image from scratch, use the colormap of the drawable you
intend to render the image to.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_image_put_pixel ()">
<a name="gdk-image-put-pixel"></a><h3>gdk_image_put_pixel ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_image_put_pixel                 (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> pixel</code></em>);</pre>
<p>
Sets a pixel in a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> to a given pixel value.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>the x coordinate of the pixel to set.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td>the y coordinate of the pixel to set.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixel</code></em> :</span></p></td>
<td>the pixel value to set.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_image_get_pixel ()">
<a name="gdk-image-get-pixel"></a><h3>gdk_image_get_pixel ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             gdk_image_get_pixel                 (<em class="parameter"><code><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *image</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>);</pre>
<p>
Gets a pixel value at a specified position in a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>the x coordinate of the pixel to get.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td>the y coordinate of the pixel to get.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the pixel value at the given position.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="gdk-Images.see-also"></a><h2>See Also</h2>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Bitmaps-and-Pixmaps.html" title="Bitmaps and Pixmaps">Bitmaps and Pixmaps</a></span></p></td>
<td><p>
Graphics which are stored on the X Windows server.
Since these are stored on the server they can be drawn very quickly, and all
of the <a class="link" href="gdk-Drawing-Primitives.html" title="Drawing Primitives">Drawing Primitives</a> can be
used to draw on them. Their main disadvantage is that manipulating individual
pixels can be very slow.
</p></td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-GdkRGB.html" title="GdkRGB">GdkRGB</a></span></p></td>
<td><p>
Built on top of <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, this provides much more functionality,
including the dithering of colors to produce better output on low-color
displays.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>