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>Pixbufs: GDK 2 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GDK 2 Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk2-Images.html" title="Images">
<link rel="next" href="gdk2-Colormaps-and-Colors.html" title="Colormaps and Colors">
<meta name="generator" content="GTK-Doc V1.26.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="#gdk2-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="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gdk2-Images.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gdk2-Colormaps-and-Colors.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gdk2-Pixbufs"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk2-Pixbufs.top_of_page"></a>Pixbufs</span></h2>
<p>Pixbufs</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gdk2-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">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-render-threshold-alpha" title="gdk_pixbuf_render_threshold_alpha ()">gdk_pixbuf_render_threshold_alpha</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-render-to-drawable" title="gdk_pixbuf_render_to_drawable ()">gdk_pixbuf_render_to_drawable</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-render-to-drawable-alpha" title="gdk_pixbuf_render_to_drawable_alpha ()">gdk_pixbuf_render_to_drawable_alpha</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-render-pixmap-and-mask" title="gdk_pixbuf_render_pixmap_and_mask ()">gdk_pixbuf_render_pixmap_and_mask</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-render-pixmap-and-mask-for-colormap" title="gdk_pixbuf_render_pixmap_and_mask_for_colormap ()">gdk_pixbuf_render_pixmap_and_mask_for_colormap</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="returnvalue">GdkPixbuf</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-get-from-drawable" title="gdk_pixbuf_get_from_drawable ()">gdk_pixbuf_get_from_drawable</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="returnvalue">GdkPixbuf</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-get-from-image" title="gdk_pixbuf_get_from_image ()">gdk_pixbuf_get_from_image</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk2-Pixbufs.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdk/gdk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gdk2-Pixbufs.description"></a><h2>Description</h2>
</div>
<div class="refsect1">
<a name="gdk2-Pixbufs.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdk-pixbuf-render-threshold-alpha"></a><h3>gdk_pixbuf_render_threshold_alpha ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_pixbuf_render_threshold_alpha (<em class="parameter"><code><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *pixbuf</code></em>,
                                   <em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> *bitmap</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>,
                                   <em class="parameter"><code><span class="type">int</span> alpha_threshold</code></em>);</pre>
<p>Takes the opacity values in a rectangular portion of a pixbuf and thresholds
them to produce a bi-level alpha mask that can be used as a clipping mask for
a drawable.</p>
<div class="refsect3">
<a name="gdk-pixbuf-render-threshold-alpha.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>pixbuf</p></td>
<td class="parameter_description"><p>A pixbuf.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>bitmap</p></td>
<td class="parameter_description"><p>Bitmap where the bilevel mask will be painted to.</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.</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.</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.</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.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>width</p></td>
<td class="parameter_description"><p>Width of region to threshold, or -1 to use pixbuf width</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>height</p></td>
<td class="parameter_description"><p>Height of region to threshold, or -1 to use pixbuf height</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>alpha_threshold</p></td>
<td class="parameter_description"><p>Opacity values below this will be painted as zero; all
other values will be painted as one.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-render-to-drawable"></a><h3>gdk_pixbuf_render_to_drawable ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_pixbuf_render_to_drawable (<em class="parameter"><code><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *pixbuf</code></em>,
                               <em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</code></em>,
                               <em class="parameter"><code><a class="link" href="gdk2-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</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>,
                               <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dither</code></em>,
                               <em class="parameter"><code><span class="type">int</span> x_dither</code></em>,
                               <em class="parameter"><code><span class="type">int</span> y_dither</code></em>);</pre>
<div class="warning">
<p><code class="literal">gdk_pixbuf_render_to_drawable</code> has been deprecated since version 2.4 and should not be used in newly-written code.</p>
<p>This function is obsolete. Use <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-pixbuf" title="gdk_draw_pixbuf ()"><code class="function">gdk_draw_pixbuf()</code></a> instead.</p>
</div>
<p>Renders a rectangular portion of a pixbuf to a drawable while using the
specified GC.  This is done using GdkRGB, so the specified drawable must have
the GdkRGB visual and colormap.  Note that this function will ignore the
opacity information for images with an alpha channel; the GC must already
have the clipping mask set if you want transparent regions to show through.</p>
<p>For an explanation of dither offsets, see the GdkRGB documentation.  In
brief, the dither offset is important when re-rendering partial regions of an
image to a rendered version of the full image, or for 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 class="refsect3">
<a name="gdk-pixbuf-render-to-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>pixbuf</p></td>
<td class="parameter_description"><p>A pixbuf.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>drawable</p></td>
<td class="parameter_description"><p>Destination drawable.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>gc</p></td>
<td class="parameter_description"><p>GC used for rendering.</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 pixbuf.</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 pixbuf.</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 within drawable.</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 within drawable.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>width</p></td>
<td class="parameter_description"><p>Width of region to render, in pixels, or -1 to use pixbuf width</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>height</p></td>
<td class="parameter_description"><p>Height of region to render, in pixels, or -1 to use pixbuf height</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dither</p></td>
<td class="parameter_description"><p>Dithering mode for GdkRGB.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x_dither</p></td>
<td class="parameter_description"><p>X offset for dither.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y_dither</p></td>
<td class="parameter_description"><p>Y offset for dither.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-render-to-drawable-alpha"></a><h3>gdk_pixbuf_render_to_drawable_alpha ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_pixbuf_render_to_drawable_alpha (<em class="parameter"><code><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *pixbuf</code></em>,
                                     <em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *drawable</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>,
                                     <em class="parameter"><code><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbufAlphaMode"><span class="type">GdkPixbufAlphaMode</span></a> alpha_mode</code></em>,
                                     <em class="parameter"><code><span class="type">int</span> alpha_threshold</code></em>,
                                     <em class="parameter"><code><a class="link" href="gdk2-GdkRGB.html#GdkRgbDither" title="enum GdkRgbDither"><span class="type">GdkRgbDither</span></a> dither</code></em>,
                                     <em class="parameter"><code><span class="type">int</span> x_dither</code></em>,
                                     <em class="parameter"><code><span class="type">int</span> y_dither</code></em>);</pre>
<div class="warning">
<p><code class="literal">gdk_pixbuf_render_to_drawable_alpha</code> has been deprecated since version 2.4 and should not be used in newly-written code.</p>
<p>This function is obsolete. Use <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-pixbuf" title="gdk_draw_pixbuf ()"><code class="function">gdk_draw_pixbuf()</code></a> instead.</p>
</div>
<p>Renders a rectangular portion of a pixbuf to a drawable.  The destination
drawable must have a colormap. All windows have a colormap, however, pixmaps
only have colormap by default if they were created with a non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> window argument.
Otherwise a colormap must be set on them with gdk_drawable_set_colormap.</p>
<p>On older X servers, rendering pixbufs with an alpha channel involves round trips
to the X server, and may be somewhat slow.</p>
<div class="refsect3">
<a name="gdk-pixbuf-render-to-drawable-alpha.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>pixbuf</p></td>
<td class="parameter_description"><p>A pixbuf.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>drawable</p></td>
<td class="parameter_description"><p>Destination drawable.</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 pixbuf.</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 coordinates within pixbuf.</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 within drawable.</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 within drawable.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>width</p></td>
<td class="parameter_description"><p>Width of region to render, in pixels, or -1 to use pixbuf width.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>height</p></td>
<td class="parameter_description"><p>Height of region to render, in pixels, or -1 to use pixbuf height.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>alpha_mode</p></td>
<td class="parameter_description"><p>Ignored. Present for backwards compatibility.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>alpha_threshold</p></td>
<td class="parameter_description"><p>Ignored. Present for backwards compatibility</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dither</p></td>
<td class="parameter_description"><p>Dithering mode for GdkRGB.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x_dither</p></td>
<td class="parameter_description"><p>X offset for dither.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y_dither</p></td>
<td class="parameter_description"><p>Y offset for dither.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-render-pixmap-and-mask"></a><h3>gdk_pixbuf_render_pixmap_and_mask ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_pixbuf_render_pixmap_and_mask (<em class="parameter"><code><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *pixbuf</code></em>,
                                   <em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a> **pixmap_return</code></em>,
                                   <em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> **mask_return</code></em>,
                                   <em class="parameter"><code><span class="type">int</span> alpha_threshold</code></em>);</pre>
<p>Creates a pixmap and a mask bitmap which are returned in the <em class="parameter"><code>pixmap_return</code></em>

and <em class="parameter"><code>mask_return</code></em>
 arguments, respectively, and renders a pixbuf and its
corresponding thresholded alpha mask to them.  This is merely a convenience
function; applications that need to render pixbufs with dither offsets or to
given drawables should use <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-pixbuf" title="gdk_draw_pixbuf ()"><code class="function">gdk_draw_pixbuf()</code></a> and <a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-render-threshold-alpha" title="gdk_pixbuf_render_threshold_alpha ()"><code class="function">gdk_pixbuf_render_threshold_alpha()</code></a>.</p>
<p>The pixmap that is created is created for the colormap returned
by <a class="link" href="gdk2-GdkRGB.html#gdk-rgb-get-colormap" title="gdk_rgb_get_colormap ()"><code class="function">gdk_rgb_get_colormap()</code></a>. You normally will want to instead use
the actual colormap for a widget, and use
<a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-render-pixmap-and-mask-for-colormap" title="gdk_pixbuf_render_pixmap_and_mask_for_colormap ()"><code class="function">gdk_pixbuf_render_pixmap_and_mask_for_colormap()</code></a>.</p>
<p>If the pixbuf does not have an alpha channel, then *<em class="parameter"><code>mask_return</code></em>
 will be set
to <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
<div class="refsect3">
<a name="gdk-pixbuf-render-pixmap-and-mask.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>pixbuf</p></td>
<td class="parameter_description"><p>A pixbuf.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pixmap_return</p></td>
<td class="parameter_description"><p>Location to store a pointer to the created pixmap,
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the pixmap is not needed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask_return</p></td>
<td class="parameter_description"><p>Location to store a pointer to the created mask,
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the mask is not needed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>alpha_threshold</p></td>
<td class="parameter_description"><p>Threshold value for opacity values.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-render-pixmap-and-mask-for-colormap"></a><h3>gdk_pixbuf_render_pixmap_and_mask_for_colormap ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_pixbuf_render_pixmap_and_mask_for_colormap
                               (<em class="parameter"><code><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *pixbuf</code></em>,
                                <em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>,
                                <em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a> **pixmap_return</code></em>,
                                <em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> **mask_return</code></em>,
                                <em class="parameter"><code><span class="type">int</span> alpha_threshold</code></em>);</pre>
<div class="warning"><p><code class="literal">gdk_pixbuf_render_pixmap_and_mask_for_colormap</code> is deprecated and should not be used in newly-written code.</p></div>
<p>Creates a pixmap and a mask bitmap which are returned in the <em class="parameter"><code>pixmap_return</code></em>

and <em class="parameter"><code>mask_return</code></em>
 arguments, respectively, and renders a pixbuf and its
corresponding tresholded alpha mask to them.  This is merely a convenience
function; applications that need to render pixbufs with dither offsets or to
given drawables should use <a class="link" href="gdk2-Drawing-Primitives.html#gdk-draw-pixbuf" title="gdk_draw_pixbuf ()"><code class="function">gdk_draw_pixbuf()</code></a>, and <a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-render-threshold-alpha" title="gdk_pixbuf_render_threshold_alpha ()"><code class="function">gdk_pixbuf_render_threshold_alpha()</code></a>.</p>
<p>The pixmap that is created uses the <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> specified by <em class="parameter"><code>colormap</code></em>
.
This colormap must match the colormap of the window where the pixmap
will eventually be used or an error will result.</p>
<p>If the pixbuf does not have an alpha channel, then *<em class="parameter"><code>mask_return</code></em>
 will be set
to <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
<div class="refsect3">
<a name="gdk-pixbuf-render-pixmap-and-mask-for-colormap.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>pixbuf</p></td>
<td class="parameter_description"><p>A pixbuf.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>colormap</p></td>
<td class="parameter_description"><p>A <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pixmap_return</p></td>
<td class="parameter_description"><p>Location to store a pointer to the created pixmap,
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the pixmap is not needed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask_return</p></td>
<td class="parameter_description"><p>Location to store a pointer to the created mask,
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the mask is not needed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>alpha_threshold</p></td>
<td class="parameter_description"><p>Threshold value for opacity values.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-get-from-drawable"></a><h3>gdk_pixbuf_get_from_drawable ()</h3>
<pre class="programlisting"><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="returnvalue">GdkPixbuf</span></a> *
gdk_pixbuf_get_from_drawable (<em class="parameter"><code><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
                              <em class="parameter"><code><a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> *src</code></em>,
                              <em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *cmap</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 <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> and converts it to an RGB(A)
representation inside a <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></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.</p>
<p>If the drawable <em class="parameter"><code>src</code></em>
 has no colormap (<a class="link" href="gdk2-Drawing-Primitives.html#gdk-drawable-get-colormap" title="gdk_drawable_get_colormap ()"><code class="function">gdk_drawable_get_colormap()</code></a>
returns <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>), then a suitable colormap must be specified.
Typically a <a class="link" href="gdk2-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> or a pixmap created by passing a <a class="link" href="gdk2-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>
to <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-new" title="gdk_pixmap_new ()"><code class="function">gdk_pixmap_new()</code></a> will already have a colormap associated with
it.  If the drawable has a colormap, the <em class="parameter"><code>cmap</code></em>
 argument will be
ignored.  If the drawable 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, <a class="link" href="gdk2-Colormaps-and-Colors.html#gdk-colormap-get-system" title="gdk_colormap_get_system ()"><code class="function">gdk_colormap_get_system()</code></a> returns
the correct colormap to use.</p>
<p>If the specified destination pixbuf <em class="parameter"><code>dest</code></em>
 is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></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.  If the specified destination pixbuf is not <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
and it contains alpha information, then the filled pixels will be
set to full opacity (alpha = 255).</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"><code class="literal">NULL</code></a>. For pixmaps only (not for windows)
passing -1 for width or height is allowed to mean the full width
or height of the pixmap.</p>
<p>If the specified drawable 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.</p>
<p>If the target drawable is not mapped (typically because it's
iconified/minimized or not on the current workspace), then <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
will be returned.</p>
<p>If memory can't be allocated for the return value, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> will be returned
instead.</p>
<p>(In short, there are several ways this function can fail, and if it fails
 it returns <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; so check the return value.)</p>
<p>This function calls <a class="link" href="gdk2-Drawing-Primitives.html#gdk-drawable-get-image" title="gdk_drawable_get_image ()"><code class="function">gdk_drawable_get_image()</code></a> internally and
converts the resulting image to a <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a>, so the
documentation for <a class="link" href="gdk2-Drawing-Primitives.html#gdk-drawable-get-image" title="gdk_drawable_get_image ()"><code class="function">gdk_drawable_get_image()</code></a> may also be relevant.</p>
<div class="refsect3">
<a name="gdk-pixbuf-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 <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if a new pixbuf should be created. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></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>
doesn't have one set.</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-get-from-drawable.returns"></a><h4>Returns</h4>
<p> The same pixbuf as <em class="parameter"><code>dest</code></em>
if it was non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, or a newly-created
pixbuf with a reference count of 1 if no destination pixbuf was specified, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-get-from-image"></a><h3>gdk_pixbuf_get_from_image ()</h3>
<pre class="programlisting"><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="returnvalue">GdkPixbuf</span></a> *
gdk_pixbuf_get_from_image (<em class="parameter"><code><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
                           <em class="parameter"><code><a class="link" href="gdk2-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> *src</code></em>,
                           <em class="parameter"><code><a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> *cmap</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>Same as <a class="link" href="gdk2-Pixbufs.html#gdk-pixbuf-get-from-drawable" title="gdk_pixbuf_get_from_drawable ()"><code class="function">gdk_pixbuf_get_from_drawable()</code></a> but gets the pixbuf from
an image.</p>
<div class="refsect3">
<a name="gdk-pixbuf-get-from-image.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 <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if a new pixbuf should be created. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>src</p></td>
<td class="parameter_description"><p>Source <a class="link" href="gdk2-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cmap</p></td>
<td class="parameter_description"><p>A colormap, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to use the one for <em class="parameter"><code>src</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></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-get-from-image.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>dest</code></em>
, newly-created pixbuf if <em class="parameter"><code>dest</code></em>
was <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gdk2-Pixbufs.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.26.1</div>
</body>
</html>