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>Bitmaps and Pixmaps: 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-Drawing-Primitives.html" title="Drawing Primitives">
<link rel="next" href="gdk2-GdkRGB.html" title="GdkRGB">
<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-Bitmaps-and-Pixmaps.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#gdk2-Bitmaps-and-Pixmaps.object-hierarchy" class="shortcut">Object Hierarchy</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-Drawing-Primitives.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gdk2-GdkRGB.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gdk2-Bitmaps-and-Pixmaps"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk2-Bitmaps-and-Pixmaps.top_of_page"></a>Bitmaps and Pixmaps</span></h2>
<p>Bitmaps and Pixmaps</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gdk2-Bitmaps-and-Pixmaps.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="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-new" title="gdk_pixmap_new ()">gdk_pixmap_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="returnvalue">GdkBitmap</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-bitmap-create-from-data" title="gdk_bitmap_create_from_data ()">gdk_bitmap_create_from_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-create-from-data" title="gdk_pixmap_create_from_data ()">gdk_pixmap_create_from_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-create-from-xpm" title="gdk_pixmap_create_from_xpm ()">gdk_pixmap_create_from_xpm</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-colormap-create-from-xpm" title="gdk_pixmap_colormap_create_from_xpm ()">gdk_pixmap_colormap_create_from_xpm</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-create-from-xpm-d" title="gdk_pixmap_create_from_xpm_d ()">gdk_pixmap_create_from_xpm_d</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
</td>
<td class="function_name">
<a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-colormap-create-from-xpm-d" title="gdk_pixmap_colormap_create_from_xpm_d ()">gdk_pixmap_colormap_create_from_xpm_d</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-Bitmaps-and-Pixmaps.html#gdk-pixmap-get-size" title="gdk_pixmap_get_size ()">gdk_pixmap_get_size</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<a name="GdkPixmap"></a><div class="refsect1">
<a name="gdk2-Bitmaps-and-Pixmaps.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-ref" title="gdk_pixmap_ref">gdk_pixmap_ref</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-unref" title="gdk_pixmap_unref">gdk_pixmap_unref</a></td>
</tr>
<tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap">GdkBitmap</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-bitmap-ref" title="gdk_bitmap_ref">gdk_bitmap_ref</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-bitmap-unref" title="gdk_bitmap_unref">gdk_bitmap_unref</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gdk2-Bitmaps-and-Pixmaps.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="../gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
    <span class="lineart">╰──</span> <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a>
        <span class="lineart">╰──</span> GdkPixmap
</pre>
</div>
<div class="refsect1">
<a name="gdk2-Bitmaps-and-Pixmaps.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdk/gdk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gdk2-Bitmaps-and-Pixmaps.description"></a><h2>Description</h2>
</div>
<div class="refsect1">
<a name="gdk2-Bitmaps-and-Pixmaps.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdk-pixmap-new"></a><h3>gdk_pixmap_new ()</h3>
<pre class="programlisting"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
gdk_pixmap_new (<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 href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
                <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>,
                <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="gdk-bitmap-create-from-data"></a><h3>gdk_bitmap_create_from_data ()</h3>
<pre class="programlisting"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="returnvalue">GdkBitmap</span></a> *
gdk_bitmap_create_from_data (<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>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *data</code></em>,
                             <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
                             <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>);</pre>
<div class="warning"><p><code class="literal">gdk_bitmap_create_from_data</code> is deprecated and should not be used in newly-written code.</p></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixmap-create-from-data"></a><h3>gdk_pixmap_create_from_data ()</h3>
<pre class="programlisting"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
gdk_pixmap_create_from_data (<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>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *data</code></em>,
                             <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
                             <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>,
                             <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>,
                             <em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *fg</code></em>,
                             <em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *bg</code></em>);</pre>
<div class="warning"><p><code class="literal">gdk_pixmap_create_from_data</code> is deprecated and should not be used in newly-written code.</p></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixmap-create-from-xpm"></a><h3>gdk_pixmap_create_from_xpm ()</h3>
<pre class="programlisting"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
gdk_pixmap_create_from_xpm (<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-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> **mask</code></em>,
                            <em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *transparent_color</code></em>,
                            <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);</pre>
<div class="warning">
<p><code class="literal">gdk_pixmap_create_from_xpm</code> has been deprecated since version 2.22 and should not be used in newly-written code.</p>
<p>Use a <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> instead. You can use
<a href="../gdk-pixbuf/gdk-pixbuf-File-Loading.html#gdk-pixbuf-new-from-file"><code class="function">gdk_pixbuf_new_from_file()</code></a> to create it.
If you must use a pixmap, use <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-new" title="gdk_pixmap_new ()"><code class="function">gdk_pixmap_new()</code></a> to
create it and Cairo to draw the pixbuf onto it.</p>
</div>
<p>Create a pixmap from a XPM file.</p>
<div class="refsect3">
<a name="gdk-pixmap-create-from-xpm.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>drawable</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>, used to determine default values
for the new pixmap.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>(out) a pointer to a place to store a bitmap representing
the transparency mask of the XPM file. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
in which case transparency will be ignored.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>transparent_color</p></td>
<td class="parameter_description"><p>the color to be used for the pixels
that are transparent in the input file. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
in which case a default color will be used.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description"><p>the filename of a file containing XPM data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-pixmap-create-from-xpm.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixmap-colormap-create-from-xpm"></a><h3>gdk_pixmap_colormap_create_from_xpm ()</h3>
<pre class="programlisting"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
gdk_pixmap_colormap_create_from_xpm (<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-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#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> **mask</code></em>,
                                     <em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *transparent_color</code></em>,
                                     <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);</pre>
<div class="warning">
<p><code class="literal">gdk_pixmap_colormap_create_from_xpm</code> has been deprecated since version 2.22 and should not be used in newly-written code.</p>
<p>Use a <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> instead. You can use
<a href="../gdk-pixbuf/gdk-pixbuf-File-Loading.html#gdk-pixbuf-new-from-file"><code class="function">gdk_pixbuf_new_from_file()</code></a> to create it.
If you must use a pixmap, use <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-new" title="gdk_pixmap_new ()"><code class="function">gdk_pixmap_new()</code></a> to
create it and Cairo to draw the pixbuf onto it.</p>
</div>
<p>Create a pixmap from a XPM file using a particular colormap.</p>
<div class="refsect3">
<a name="gdk-pixmap-colormap-create-from-xpm.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>drawable</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>, used to determine default values
for the new pixmap. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>colormap</code></em>
is given.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>colormap</p></td>
<td class="parameter_description"><p>the <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> that the new pixmap will be use.
If omitted, the colormap for <em class="parameter"><code>window</code></em>
will be used.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>a pointer to a place to store a bitmap representing
the transparency mask of the XPM file. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
in which case transparency will be ignored.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>transparent_color</p></td>
<td class="parameter_description"><p>the color to be used for the pixels
that are transparent in the input file. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
in which case a default color will be used.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description"><p>the filename of a file containing XPM data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-pixmap-colormap-create-from-xpm.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixmap-create-from-xpm-d"></a><h3>gdk_pixmap_create_from_xpm_d ()</h3>
<pre class="programlisting"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
gdk_pixmap_create_from_xpm_d (<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-Bitmaps-and-Pixmaps.html#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> **mask</code></em>,
                              <em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *transparent_color</code></em>,
                              <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **data</code></em>);</pre>
<div class="warning">
<p><code class="literal">gdk_pixmap_create_from_xpm_d</code> has been deprecated since version 2.22 and should not be used in newly-written code.</p>
<p>Use a <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> instead. You can use
<a href="../gdk-pixbuf/gdk-pixbuf-Image-Data-in-Memory.html#gdk-pixbuf-new-from-xpm-data"><code class="function">gdk_pixbuf_new_from_xpm_data()</code></a> to create it.
If you must use a pixmap, use <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-new" title="gdk_pixmap_new ()"><code class="function">gdk_pixmap_new()</code></a> to
create it and Cairo to draw the pixbuf onto it.</p>
</div>
<p>Create a pixmap from data in XPM format.</p>
<div class="refsect3">
<a name="gdk-pixmap-create-from-xpm-d.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>drawable</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>, used to determine default values
for the new pixmap.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>Pointer to a place to store a bitmap representing
the transparency mask of the XPM file. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
in which case transparency will be ignored. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>transparent_color</p></td>
<td class="parameter_description"><p>This color will be used for the pixels
that are transparent in the input file. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
in which case a default color will be used.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>Pointer to a string containing the XPM data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-pixmap-create-from-xpm-d.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixmap-colormap-create-from-xpm-d"></a><h3>gdk_pixmap_colormap_create_from_xpm_d ()</h3>
<pre class="programlisting"><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="returnvalue">GdkPixmap</span></a> *
gdk_pixmap_colormap_create_from_xpm_d (<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-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#GdkBitmap" title="GdkBitmap"><span class="type">GdkBitmap</span></a> **mask</code></em>,
                                       <em class="parameter"><code>const <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *transparent_color</code></em>,
                                       <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **data</code></em>);</pre>
<div class="warning">
<p><code class="literal">gdk_pixmap_colormap_create_from_xpm_d</code> has been deprecated since version 2.22 and should not be used in newly-written code.</p>
<p>Use a <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> instead. You can use
<a href="../gdk-pixbuf/gdk-pixbuf-Image-Data-in-Memory.html#gdk-pixbuf-new-from-xpm-data"><code class="function">gdk_pixbuf_new_from_xpm_data()</code></a> to create it.
If you must use a pixmap, use <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#gdk-pixmap-new" title="gdk_pixmap_new ()"><code class="function">gdk_pixmap_new()</code></a> to
create it and Cairo to draw the pixbuf onto it.</p>
</div>
<p>Create a pixmap from data in XPM format using a particular
colormap.</p>
<div class="refsect3">
<a name="gdk-pixmap-colormap-create-from-xpm-d.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>drawable</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>, used to determine default values
for the new pixmap. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>colormap</code></em>
is given.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>colormap</p></td>
<td class="parameter_description"><p>the <a class="link" href="gdk2-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> that the new pixmap will be use.
If omitted, the colormap for <em class="parameter"><code>window</code></em>
will be used.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mask</p></td>
<td class="parameter_description"><p>a pointer to a place to store a bitmap representing
the transparency mask of the XPM file. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
in which case transparency will be ignored.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>transparent_color</p></td>
<td class="parameter_description"><p>the color to be used for the pixels
that are transparent in the input file. Can be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
in which case a default color will be used.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>Pointer to a string containing the XPM data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-pixmap-colormap-create-from-xpm-d.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixmap-get-size"></a><h3>gdk_pixmap_get_size ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_pixmap_get_size (<em class="parameter"><code><a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a> *pixmap</code></em>,
                     <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *width</code></em>,
                     <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *height</code></em>);</pre>
<p>This function is purely to make it possible to query the size of pixmaps
even when compiling without deprecated symbols and you must use pixmaps.
It is identical to <a class="link" href="gdk2-Drawing-Primitives.html#gdk-drawable-get-size" title="gdk_drawable_get_size ()"><code class="function">gdk_drawable_get_size()</code></a>, but for pixmaps.</p>
<div class="refsect3">
<a name="gdk-pixmap-get-size.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>pixmap</p></td>
<td class="parameter_description"><p>a <a class="link" href="gdk2-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>width</p></td>
<td class="parameter_description"><p>location to store <em class="parameter"><code>pixmap</code></em>
's width, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<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>height</p></td>
<td class="parameter_description"><p>location to store <em class="parameter"><code>pixmap</code></em>
's height, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.24</p>
</div>
</div>
<div class="refsect1">
<a name="gdk2-Bitmaps-and-Pixmaps.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GdkPixmap"></a><h3>GdkPixmap</h3>
<pre class="programlisting">typedef struct _GdkDrawable           GdkPixmap;
</pre>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixmap-ref"></a><h3>gdk_pixmap_ref</h3>
<pre class="programlisting">#define gdk_pixmap_ref                 g_object_ref
</pre>
<div class="warning"><p><code class="literal">gdk_pixmap_ref</code> is deprecated and should not be used in newly-written code.</p></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixmap-unref"></a><h3>gdk_pixmap_unref</h3>
<pre class="programlisting">#define gdk_pixmap_unref               g_object_unref
</pre>
<div class="warning"><p><code class="literal">gdk_pixmap_unref</code> is deprecated and should not be used in newly-written code.</p></div>
</div>
<hr>
<div class="refsect2">
<a name="GdkBitmap"></a><h3>GdkBitmap</h3>
<pre class="programlisting">typedef struct _GdkDrawable           GdkBitmap;
</pre>
</div>
<hr>
<div class="refsect2">
<a name="gdk-bitmap-ref"></a><h3>gdk_bitmap_ref</h3>
<pre class="programlisting">#define gdk_bitmap_ref                 g_object_ref
</pre>
<div class="warning"><p><code class="literal">gdk_bitmap_ref</code> is deprecated and should not be used in newly-written code.</p></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-bitmap-unref"></a><h3>gdk_bitmap_unref</h3>
<pre class="programlisting">#define gdk_bitmap_unref               g_object_unref
</pre>
<div class="warning"><p><code class="literal">gdk_bitmap_unref</code> is deprecated and should not be used in newly-written code.</p></div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.26.1</div>
</body>
</html>