Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>X Drawables to Pixbufs: GDK-PixBuf Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GDK-PixBuf Reference Manual">
<link rel="up" href="rn01.html" title="API Reference">
<link rel="prev" href="gdk-pixbuf-Xlib-Rendering.html" title="Xlib Rendering">
<link rel="next" href="gdk-pixbuf-XlibRGB.html" title="XlibRGB">
<meta name="generator" content="GTK-Doc V1.25.1 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gdk-pixbuf-X-Drawables-to-Pixbufs.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="rn01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gdk-pixbuf-Xlib-Rendering.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gdk-pixbuf-XlibRGB.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gdk-pixbuf-X-Drawables-to-Pixbufs"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-pixbuf-X-Drawables-to-Pixbufs.top_of_page"></a>X Drawables to Pixbufs</span></h2>
<p>X Drawables to Pixbufs — Getting parts of an X drawable's image data into a pixbuf.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gdk-pixbuf-X-Drawables-to-Pixbufs.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody><tr>
<td class="function_type">
<a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk-pixbuf-X-Drawables-to-Pixbufs.html#gdk-pixbuf-xlib-get-from-drawable" title="gdk_pixbuf_xlib_get_from_drawable ()">gdk_pixbuf_xlib_get_from_drawable</a> <span class="c_punctuation">()</span>
</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk-pixbuf-X-Drawables-to-Pixbufs.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gdk-pixbuf-X-Drawables-to-Pixbufs.description"></a><h2>Description</h2>
<p>The functions in this section allow you to take the image data
from an X drawable and dump it into a <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>.  This can be
used for screenshots and other special effects.  Note that these
operations can be expensive, since the image data has to be
transferred from the X server to the client program and converted.</p>
<p>These functions are analogous to those for the GDK version of
&amp;gdk-pixbuf;.</p>
</div>
<div class="refsect1">
<a name="gdk-pixbuf-X-Drawables-to-Pixbufs.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdk-pixbuf-xlib-get-from-drawable"></a><h3>gdk_pixbuf_xlib_get_from_drawable ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *
gdk_pixbuf_xlib_get_from_drawable (<em class="parameter"><code><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
                                   <em class="parameter"><code><span class="type">Drawable</span> src</code></em>,
                                   <em class="parameter"><code><span class="type">Colormap</span> cmap</code></em>,
                                   <em class="parameter"><code><span class="type">Visual</span> *visual</code></em>,
                                   <em class="parameter"><code><span class="type">int</span> src_x</code></em>,
                                   <em class="parameter"><code><span class="type">int</span> src_y</code></em>,
                                   <em class="parameter"><code><span class="type">int</span> dest_x</code></em>,
                                   <em class="parameter"><code><span class="type">int</span> dest_y</code></em>,
                                   <em class="parameter"><code><span class="type">int</span> width</code></em>,
                                   <em class="parameter"><code><span class="type">int</span> height</code></em>);</pre>
<p>Transfers image data from a Gdk drawable and converts it to an RGB(A)
representation inside a GdkPixbuf.</p>
<p>If the drawable <em class="parameter"><code>src</code></em>
 is a pixmap, then a suitable colormap must be specified,
since pixmaps are just blocks of pixel data without an associated colormap.
If the drawable is a window, the <em class="parameter"><code>cmap</code></em>
 argument will be ignored and the
window's own colormap will be used instead.</p>
<p>If the specified destination pixbuf <em class="parameter"><code>dest</code></em>
 is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, then this function will
create an RGB pixbuf with 8 bits per channel and no alpha, with the same size
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
<em class="parameter"><code>dest_y</code></em>
 arguments must be specified as 0, otherwise the function will return
<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>.  If the specified destination pixbuf is not NULL and it contains alpha
information, then the filled pixels will be set to full opacity.</p>
<p>If the specified drawable is a pixmap, then the requested source rectangle
must be completely contained within the pixmap, otherwise the function will
return <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>.</p>
<p>If the specified drawable is a window, then it must be viewable, i.e. all of
its ancestors up to the root window must be mapped.  Also, the specified
source rectangle must be completely contained within the window and within
the screen.  If regions of the window are obscured by noninferior windows, the
contents of those regions are undefined.  The contents of regions obscured by
inferior windows of a different depth than that of the source window will also
be undefined.</p>
<div class="refsect3">
<a name="gdk-pixbuf-xlib-get-from-drawable.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>dest</p></td>
<td class="parameter_description"><p>Destination pixbuf, or NULL if a new pixbuf should be created.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src</p></td>
<td class="parameter_description"><p>Source drawable.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cmap</p></td>
<td class="parameter_description"><p>A colormap if <em class="parameter"><code>src</code></em>
is a pixmap.  If it is a window, this argument will
be ignored.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>visual</p></td>
<td class="parameter_description"><p>A visual if <em class="parameter"><code>src</code></em>
is a pixmap.  If it is a window, this argument will
be ignored.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src_x</p></td>
<td class="parameter_description"><p>Source X coordinate within drawable.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src_y</p></td>
<td class="parameter_description"><p>Source Y coordinate within drawable.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest_x</p></td>
<td class="parameter_description"><p>Destination X coordinate in pixbuf, or 0 if <em class="parameter"><code>dest</code></em>
is NULL.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest_y</p></td>
<td class="parameter_description"><p>Destination Y coordinate in pixbuf, or 0 if <em class="parameter"><code>dest</code></em>
is NULL.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>width</p></td>
<td class="parameter_description"><p>Width in pixels of region to get.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>height</p></td>
<td class="parameter_description"><p>Height in pixels of region to get.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-pixbuf-xlib-get-from-drawable.returns"></a><h4>Returns</h4>
<p> The same pixbuf as <em class="parameter"><code>dest</code></em>
if it was non-NULL, or a newly-created
pixbuf with a reference count of 1 if no destination pixbuf was specified; in
the latter case, NULL will be returned if not enough memory could be
allocated for the pixbuf to be created.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gdk-pixbuf-X-Drawables-to-Pixbufs.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25.1</div>
</body>
</html>