?? gdk-bitmaps-and-pixmaps.html
字號:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>Bitmaps and Pixmaps</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="GDK Reference Manual"><link rel="up" href="reference.html" title="API Reference"><link rel="prev" href="gdk-Drawing-Primitives.html" title="Drawing Primitives"><link rel="next" href="gdk-GdkRGB.html" title="GdkRGB"><meta name="generator" content="GTK-Doc V1.9 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="reference" href="reference.html" title="API Reference"><link rel="index" href="ix01.html" title="Index"><link rel="index" href="ix02.html" title="Index of deprecated symbols"><link rel="index" href="ix03.html" title="Index of new symbols in 2.2"><link rel="index" href="ix04.html" title="Index of new symbols in 2.4"><link rel="index" href="ix05.html" title="Index of new symbols in 2.6"><link rel="index" href="ix06.html" title="Index of new symbols in 2.8"><link rel="index" href="ix07.html" title="Index of new symbols in 2.10"><link rel="index" href="ix08.html" title="Index of new symbols in 2.12"></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="2"><tr valign="middle"><td><a accesskey="p" href="gdk-Drawing-Primitives.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GDK Reference Manual</th><td><a accesskey="n" href="gdk-GdkRGB.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#id3120518" class="shortcut">Top</a>  |  <a href="#id3120987" class="shortcut">Description</a>  |  <a href="#id3120955" class="shortcut">Object Hierarchy</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="gdk-Bitmaps-and-Pixmaps"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id3120518"></a><span class="refentrytitle">Bitmaps and Pixmaps</span></h2><p>Bitmaps and Pixmaps — Offscreen drawables</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><a name="GdkPixmap"></a><pre class="synopsis">#include <gdk/gdk.h>struct <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap-struct">GdkPixmap</a>;<a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a>* <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-pixmap-new">gdk_pixmap_new</a> (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> width, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> height, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> depth);<a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a>* <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-bitmap-create-from-data">gdk_bitmap_create_from_data</a> (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *data, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> width, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> height);<a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a>* <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-pixmap-create-from-data">gdk_pixmap_create_from_data</a> (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *data, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> width, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> height, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> depth, const <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *fg, const <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *bg);<a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a>* <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-pixmap-create-from-xpm">gdk_pixmap_create_from_xpm</a> (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a> **mask, const <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *transparent_color, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *filename);<a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a>* <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-pixmap-colormap-create-from-xpm">gdk_pixmap_colormap_create_from_xpm</a> (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap, <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a> **mask, const <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *transparent_color, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *filename);<a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a>* <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-pixmap-create-from-xpm-d">gdk_pixmap_create_from_xpm_d</a> (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a> **mask, const <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *transparent_color, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> **data);<a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a>* <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-pixmap-colormap-create-from-xpm-d">gdk_pixmap_colormap_create_from_xpm_d</a> (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap, <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a> **mask, const <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *transparent_color, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> **data);#define <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-pixmap-ref">gdk_pixmap_ref</a>#define <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-pixmap-unref">gdk_pixmap_unref</a>typedef <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a>;#define <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-bitmap-ref">gdk_bitmap_ref</a>#define <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#gdk-bitmap-unref">gdk_bitmap_unref</a></pre></div><div class="refsect1" lang="en"><a name="id3120955"></a><h2>Object Hierarchy</h2><pre class="synopsis"> <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a> +----<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> +----GdkPixmap</pre></div><div class="refsect1" lang="en"><a name="id3120987"></a><h2>Description</h2><p>Pixmaps are offscreen drawables. They can be drawn upon with thestandard drawing primitives, then copied to another drawable (such asa <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>) with <code class="function">gdk_pixmap_draw()</code>. The depth of a pixmapis the number of bits per pixels. Bitmaps are simply pixmapswith a depth of 1. (That is, they are monochrome bitmaps - eachpixel can be either on or off).</p></div><div class="refsect1" lang="en"><a name="id3121027"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3121037"></a><h3><a name="GdkPixmap-struct"></a>struct GdkPixmap</h3><a class="indexterm" name="id3121049"></a><pre class="programlisting">struct GdkPixmap;</pre><p>An opaque structure representing an offscreen drawable.Pointers to structures of type <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a>, <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap"><span class="type">GdkBitmap</span></a>,and <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>, can often be used interchangeably. The type <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a> refers generically to any ofthese types.</p></div><hr><div class="refsect2" lang="en"><a name="id3121099"></a><h3><a name="gdk-pixmap-new"></a>gdk_pixmap_new ()</h3><a class="indexterm" name="id3121112"></a><pre class="programlisting"><a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a>* gdk_pixmap_new (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> width, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> height, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> depth);</pre><p>Create a new pixmap with a given size and depth.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td><td>A <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>, used to determine default valuesfor the new pixmap. Can be <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>depth</code></em> is specified,</td></tr><tr><td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td><td>The width of the new pixmap in pixels.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td><td>The height of the new pixmap in pixels.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>depth</code></em> :</span></p></td><td>The depth (number of bits per pixel) of the new pixmap. If -1, and <em class="parameter"><code>drawable</code></em> is not <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, the depth of the new pixmap will be equal to that of <em class="parameter"><code>drawable</code></em>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3121292"></a><h3><a name="gdk-bitmap-create-from-data"></a>gdk_bitmap_create_from_data ()</h3><a class="indexterm" name="id3121305"></a><pre class="programlisting"><a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a>* gdk_bitmap_create_from_data (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *data, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> width, <a
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -