1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>X Drawables to Pixbufs</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
<link rel="home" href="index.html" title="GDK-PixBuf Reference Manual">
8
<link rel="up" href="rn01.html" title="API Reference">
9
<link rel="prev" href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html" title="Xlib Rendering">
10
<link rel="next" href="gdk-pixbuf-gdk-pixbuf-xlib-rgb.html" title="XlibRGB">
11
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="gdk-pixbuf-gdk-pixbuf-xlib-rendering.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">GDK-PixBuf Reference Manual</th>
21
<td><a accesskey="n" href="gdk-pixbuf-gdk-pixbuf-xlib-rgb.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.synopsis" class="shortcut">Top</a>
26
<a href="#gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.description" class="shortcut">Description</a>
29
<div class="refentry" title="X Drawables to Pixbufs">
30
<a name="gdk-pixbuf-gdk-pixbuf-xlib-from-drawables"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle"><a name="gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.top_of_page"></a>X Drawables to Pixbufs</span></h2>
34
<p>X Drawables to Pixbufs — Getting parts of an X drawable's image data into a pixbuf.</p>
36
<td valign="top" align="right"></td>
38
<div class="refsynopsisdiv" title="Synopsis">
39
<a name="gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.synopsis"></a><h2>Synopsis</h2>
40
<pre class="synopsis">
41
#include <gdk-pixbuf/gdk-pixbuf.h>
43
<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> * <a class="link" href="gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.html#gdk-pixbuf-xlib-get-from-drawable" title="gdk_pixbuf_xlib_get_from_drawable ()">gdk_pixbuf_xlib_get_from_drawable</a> (<em class="parameter"><code><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
44
<em class="parameter"><code><span class="type">Drawable</span> src</code></em>,
45
<em class="parameter"><code><span class="type">Colormap</span> cmap</code></em>,
46
<em class="parameter"><code><span class="type">Visual</span> *visual</code></em>,
47
<em class="parameter"><code><span class="type">int</span> src_x</code></em>,
48
<em class="parameter"><code><span class="type">int</span> src_y</code></em>,
49
<em class="parameter"><code><span class="type">int</span> dest_x</code></em>,
50
<em class="parameter"><code><span class="type">int</span> dest_y</code></em>,
51
<em class="parameter"><code><span class="type">int</span> width</code></em>,
52
<em class="parameter"><code><span class="type">int</span> height</code></em>);
55
<div class="refsect1" title="Description">
56
<a name="gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.description"></a><h2>Description</h2>
58
The functions in this section allow you to take the image data
59
from an X drawable and dump it into a <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>. This can be
60
used for screenshots and other special effects. Note that these
61
operations can be expensive, since the image data has to be
62
transferred from the X server to the client program and converted.
65
These functions are analogous to those for the GDK version of
66
<span class="application">gdk-pixbuf</span>.
69
<div class="refsect1" title="Details">
70
<a name="gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.details"></a><h2>Details</h2>
71
<div class="refsect2" title="gdk_pixbuf_xlib_get_from_drawable ()">
72
<a name="gdk-pixbuf-xlib-get-from-drawable"></a><h3>gdk_pixbuf_xlib_get_from_drawable ()</h3>
73
<pre class="programlisting"><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> * gdk_pixbuf_xlib_get_from_drawable (<em class="parameter"><code><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
74
<em class="parameter"><code><span class="type">Drawable</span> src</code></em>,
75
<em class="parameter"><code><span class="type">Colormap</span> cmap</code></em>,
76
<em class="parameter"><code><span class="type">Visual</span> *visual</code></em>,
77
<em class="parameter"><code><span class="type">int</span> src_x</code></em>,
78
<em class="parameter"><code><span class="type">int</span> src_y</code></em>,
79
<em class="parameter"><code><span class="type">int</span> dest_x</code></em>,
80
<em class="parameter"><code><span class="type">int</span> dest_y</code></em>,
81
<em class="parameter"><code><span class="type">int</span> width</code></em>,
82
<em class="parameter"><code><span class="type">int</span> height</code></em>);</pre>
84
Transfers image data from a Gdk drawable and converts it to an RGB(A)
85
representation inside a GdkPixbuf.
88
If the drawable <em class="parameter"><code>src</code></em> is a pixmap, then a suitable colormap must be specified,
89
since pixmaps are just blocks of pixel data without an associated colormap.
90
If the drawable is a window, the <em class="parameter"><code>cmap</code></em> argument will be ignored and the
91
window's own colormap will be used instead.
94
If the specified destination pixbuf <em class="parameter"><code>dest</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, then this function will
95
create an RGB pixbuf with 8 bits per channel and no alpha, with the same size
96
specified by the <em class="parameter"><code>width</code></em> and <em class="parameter"><code>height</code></em> arguments. In this case, the <em class="parameter"><code>dest_x</code></em> and
97
<em class="parameter"><code>dest_y</code></em> arguments must be specified as 0, otherwise the function will return
98
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>. If the specified destination pixbuf is not NULL and it contains alpha
99
information, then the filled pixels will be set to full opacity.
102
If the specified drawable is a pixmap, then the requested source rectangle
103
must be completely contained within the pixmap, otherwise the function will
104
return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>.
107
If the specified drawable is a window, then it must be viewable, i.e. all of
108
its ancestors up to the root window must be mapped. Also, the specified
109
source rectangle must be completely contained within the window and within
110
the screen. If regions of the window are obscured by noninferior windows, the
111
contents of those regions are undefined. The contents of regions obscured by
112
inferior windows of a different depth than that of the source window will also
115
<div class="variablelist"><table border="0">
116
<col align="left" valign="top">
119
<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
120
<td>Destination pixbuf, or NULL if a new pixbuf should be created.
124
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
129
<td><p><span class="term"><em class="parameter"><code>cmap</code></em> :</span></p></td>
130
<td>A colormap if <em class="parameter"><code>src</code></em> is a pixmap. If it is a window, this argument will
135
<td><p><span class="term"><em class="parameter"><code>visual</code></em> :</span></p></td>
136
<td>A visual if <em class="parameter"><code>src</code></em> is a pixmap. If it is a window, this argument will
141
<td><p><span class="term"><em class="parameter"><code>src_x</code></em> :</span></p></td>
142
<td>Source X coordinate within drawable.
146
<td><p><span class="term"><em class="parameter"><code>src_y</code></em> :</span></p></td>
147
<td>Source Y coordinate within drawable.
151
<td><p><span class="term"><em class="parameter"><code>dest_x</code></em> :</span></p></td>
152
<td>Destination X coordinate in pixbuf, or 0 if <em class="parameter"><code>dest</code></em> is NULL.
156
<td><p><span class="term"><em class="parameter"><code>dest_y</code></em> :</span></p></td>
157
<td>Destination Y coordinate in pixbuf, or 0 if <em class="parameter"><code>dest</code></em> is NULL.
161
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
162
<td>Width in pixels of region to get.
166
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
167
<td>Height in pixels of region to get.
171
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
172
<td> The same pixbuf as <em class="parameter"><code>dest</code></em> if it was non-NULL, or a newly-created
173
pixbuf with a reference count of 1 if no destination pixbuf was specified; in
174
the latter case, NULL will be returned if not enough memory could be
175
allocated for the pixbuf to be created.
185
Generated by GTK-Doc V1.15</div>
b'\\ No newline at end of file'