~ubuntu-branches/ubuntu/precise/gdk-pixbuf/precise-proposed

« back to all changes in this revision

Viewing changes to doc/sgml/gdk-pixbuf-xlib-from-drawables.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2004-10-06 22:10:04 UTC
  • Revision ID: james.westby@ubuntu.com-20041006221004-rma9deknj8qctu67
Tags: upstream-0.22.0
ImportĀ upstreamĀ versionĀ 0.22.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<refentry id="gdk-pixbuf-gdk-pixbuf-xlib-from-drawables">
 
2
<refmeta>
 
3
<refentrytitle>X Drawables to Pixbufs</refentrytitle>
 
4
<manvolnum>3</manvolnum>
 
5
<refmiscinfo>GDK-PIXBUF Library</refmiscinfo>
 
6
</refmeta>
 
7
 
 
8
<refnamediv>
 
9
<refname>X Drawables to Pixbufs</refname><refpurpose>Getting parts of an X drawable's image data into a pixbuf.</refpurpose>
 
10
</refnamediv>
 
11
 
 
12
<refsynopsisdiv><title>Synopsis</title>
 
13
<synopsis>
 
14
 
 
15
#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;
 
16
 
 
17
 
 
18
<link linkend="GdkPixbuf">GdkPixbuf</link>*  <link linkend="gdk-pixbuf-xlib-get-from-drawable">gdk_pixbuf_xlib_get_from_drawable</link>
 
19
                                            (<link linkend="GdkPixbuf">GdkPixbuf</link> *dest,
 
20
                                             <link linkend="Drawable">Drawable</link> src,
 
21
                                             <link linkend="Colormap">Colormap</link> cmap,
 
22
                                             <link linkend="Visual">Visual</link> *visual,
 
23
                                             int src_x,
 
24
                                             int src_y,
 
25
                                             int dest_x,
 
26
                                             int dest_y,
 
27
                                             int width,
 
28
                                             int height);
 
29
</synopsis>
 
30
</refsynopsisdiv>
 
31
 
 
32
 
 
33
 
 
34
 
 
35
 
 
36
<refsect1>
 
37
<title>Description</title>
 
38
  <para>
 
39
    The functions in this section allow you to take the image data
 
40
    from an X drawable and dump it into a <link linkend="GdkPixbuf">GdkPixbuf</link>.  This can be
 
41
    used for screenshots and other special effects.  Note that these
 
42
    operations can be expensive, since the image data has to be
 
43
    transferred from the X server to the client program and converted.
 
44
  </para>
 
45
 
 
46
  <para>
 
47
    These functions are analogous to those for the Gdk version of
 
48
    &gdk-pixbuf;.
 
49
  </para>
 
50
</refsect1>
 
51
 
 
52
<refsect1>
 
53
<title>Details</title>
 
54
<refsect2>
 
55
<title><anchor id="gdk-pixbuf-xlib-get-from-drawable">gdk_pixbuf_xlib_get_from_drawable ()</title>
 
56
<programlisting><link linkend="GdkPixbuf">GdkPixbuf</link>*  gdk_pixbuf_xlib_get_from_drawable
 
57
                                            (<link linkend="GdkPixbuf">GdkPixbuf</link> *dest,
 
58
                                             <link linkend="Drawable">Drawable</link> src,
 
59
                                             <link linkend="Colormap">Colormap</link> cmap,
 
60
                                             <link linkend="Visual">Visual</link> *visual,
 
61
                                             int src_x,
 
62
                                             int src_y,
 
63
                                             int dest_x,
 
64
                                             int dest_y,
 
65
                                             int width,
 
66
                                             int height);</programlisting>
 
67
<para>
 
68
Transfers image data from a Gdk drawable and converts it to an RGB(A)
 
69
representation inside a GdkPixbuf.
 
70
</para>
 
71
<para>
 
72
If the drawable <parameter>src</parameter> is a pixmap, then a suitable colormap must be specified,
 
73
since pixmaps are just blocks of pixel data without an associated colormap.
 
74
If the drawable is a window, the <parameter>cmap</parameter> argument will be ignored and the
 
75
window's own colormap will be used instead.
 
76
</para>
 
77
<para>
 
78
If the specified destination pixbuf <parameter>dest</parameter> is <literal>NULL</literal>, then this function will
 
79
create an RGB pixbuf with 8 bits per channel and no alpha, with the same size
 
80
specified by the <parameter>width</parameter> and <parameter>height</parameter> arguments.  In this case, the <parameter>dest_x</parameter> and
 
81
<parameter>dest_y</parameter> arguments must be specified as 0, otherwise the function will return
 
82
<literal>NULL</literal>.  If the specified destination pixbuf is not <literal>NULL</literal> and it contains alpha
 
83
information, then the filled pixels will be set to full opacity.
 
84
</para>
 
85
<para>
 
86
If the specified drawable is a pixmap, then the requested source rectangle
 
87
must be completely contained within the pixmap, otherwise the function will
 
88
return <literal>NULL</literal>.
 
89
</para>
 
90
<para>
 
91
If the specified drawable is a window, then it must be viewable, i.e. all of
 
92
its ancestors up to the root window must be mapped.  Also, the specified
 
93
source rectangle must be completely contained within the window and within
 
94
the screen.  If regions of the window are obscured by noninferior windows, the
 
95
contents of those regions are undefined.  The contents of regions obscured by
 
96
inferior windows of a different depth than that of the source window will also
 
97
be undefined.</para>
 
98
<para>
 
99
 
 
100
</para><informaltable pgwide=1 frame="none" role="params">
 
101
<tgroup cols="2">
 
102
<colspec colwidth="2*">
 
103
<colspec colwidth="8*">
 
104
<tbody>
 
105
<row><entry align="right"><parameter>dest</parameter>&nbsp;:</entry>
 
106
<entry> Destination pixbuf, or <literal>NULL</literal> if a new pixbuf should be created.
 
107
</entry></row>
 
108
<row><entry align="right"><parameter>src</parameter>&nbsp;:</entry>
 
109
<entry> Source drawable.
 
110
</entry></row>
 
111
<row><entry align="right"><parameter>cmap</parameter>&nbsp;:</entry>
 
112
<entry> A colormap if <parameter>src</parameter> is a pixmap.  If it is a window, this argument will
 
113
be ignored.
 
114
</entry></row>
 
115
<row><entry align="right"><parameter>visual</parameter>&nbsp;:</entry>
 
116
<entry> A visual if <parameter>src</parameter> is a pixmap.  If it is a window, this argument will
 
117
be ignored.
 
118
</entry></row>
 
119
<row><entry align="right"><parameter>src_x</parameter>&nbsp;:</entry>
 
120
<entry> Source X coordinate within drawable.
 
121
</entry></row>
 
122
<row><entry align="right"><parameter>src_y</parameter>&nbsp;:</entry>
 
123
<entry> Source Y coordinate within drawable.
 
124
</entry></row>
 
125
<row><entry align="right"><parameter>dest_x</parameter>&nbsp;:</entry>
 
126
<entry> Destination X coordinate in pixbuf, or 0 if <parameter>dest</parameter> is <literal>NULL</literal>.
 
127
</entry></row>
 
128
<row><entry align="right"><parameter>dest_y</parameter>&nbsp;:</entry>
 
129
<entry> Destination Y coordinate in pixbuf, or 0 if <parameter>dest</parameter> is <literal>NULL</literal>.
 
130
</entry></row>
 
131
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
 
132
<entry> Width in pixels of region to get.
 
133
</entry></row>
 
134
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
 
135
<entry> Height in pixels of region to get.
 
136
</entry></row>
 
137
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The same pixbuf as <parameter>dest</parameter> if it was non-<literal>NULL</literal>, or a newly-created
 
138
pixbuf with a reference count of 1 if no destination pixbuf was specified; in
 
139
the latter case, <literal>NULL</literal> will be returned if not enough memory could be
 
140
allocated for the pixbuf to be created.
 
141
</entry></row>
 
142
</tbody></tgroup></informaltable></refsect2>
 
143
 
 
144
</refsect1>
 
145
 
 
146
 
 
147
 
 
148
 
 
149
</refentry>