?? gdk-colormaps-and-colors.html
字號:
</table></div></div><hr><div class="refsect2" lang="en"><a name="id3147627"></a><h3><a name="gdk-colormap-query-color"></a>gdk_colormap_query_color ()</h3><a class="indexterm" name="id3147641"></a><pre class="programlisting">void gdk_colormap_query_color (<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong">gulong</a> pixel, <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *result);</pre><p>Locates the RGB color in <em class="parameter"><code>colormap</code></em> corresponding to the givenhardware pixel <em class="parameter"><code>pixel</code></em>. <em class="parameter"><code>pixel</code></em> must be a valid pixel in thecolormap; it's a programmer error to call this function with apixel which is not in the colormap. Hardware pixels are normallyobtained from <a class="link" href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-colors"><code class="function">gdk_colormap_alloc_colors()</code></a>, or from a <a class="link" href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>. (A<a class="link" href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a> contains image data in hardware format, a <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>contains image data in a canonical 24-bit RGB format.)</p><p>This function is rarely useful; it's used for example toimplement the eyedropper feature in <ahref="/usr/share/gtk-doc/html/gtk/GtkColorSelection.html"><span class="type">GtkColorSelection</span></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td><td> a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>pixel</code></em> :</span></p></td><td> pixel value in hardware display format</td></tr><tr><td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td><td> <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a> with red, green, blue fields initialized</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3147823"></a><h3><a name="gdk-colormap-get-visual"></a>gdk_colormap_get_visual ()</h3><a class="indexterm" name="id3147836"></a><pre class="programlisting"><a class="link" href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* gdk_colormap_get_visual (<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap);</pre><p>Returns the visual for which a given colormap was created.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td><td> a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the visual of the colormap.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3147905"></a><h3><a name="gdk-colormap-get-screen"></a>gdk_colormap_get_screen ()</h3><a class="indexterm" name="id3147920"></a><pre class="programlisting"><a class="link" href="GdkScreen.html" title="GdkScreen">GdkScreen</a>* gdk_colormap_get_screen (<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *cmap);</pre><p>Gets the screen for which this colormap was created.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cmap</code></em> :</span></p></td><td> a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the screen for which this colormap was created.</td></tr></tbody></table></div><p class="since">Since 2.2</p></div><hr><div class="refsect2" lang="en"><a name="id3147996"></a><h3><a name="gdk-colors-store"></a>gdk_colors_store ()</h3><a class="indexterm" name="id3148011"></a><pre class="programlisting">void gdk_colors_store (<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap, <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colors, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> ncolors);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gdk_colors_store</code> is deprecated and should not be used in newly-written code.</p></div><p>Changes the value of the first <em class="parameter"><code>ncolors</code></em> colors ina private colormap. This function is obsolete andshould not be used. See <a class="link" href="gdk-Colormaps-and-Colors.html#gdk-color-change"><code class="function">gdk_color_change()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td><td> a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>colors</code></em> :</span></p></td><td> the new color values.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>ncolors</code></em> :</span></p></td><td> the number of colors to change.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3148143"></a><h3><a name="gdk-color-copy"></a>gdk_color_copy ()</h3><a class="indexterm" name="id3148156"></a><pre class="programlisting"><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a>* gdk_color_copy (const <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre><p>Makes a copy of a color structure. The resultmust be freed using <a class="link" href="gdk-Colormaps-and-Colors.html#gdk-color-free"><code class="function">gdk_color_free()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td><td> a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a copy of <em class="parameter"><code>color</code></em>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3148240"></a><h3><a name="gdk-color-free"></a>gdk_color_free ()</h3><a class="indexterm" name="id3148253"></a><pre class="programlisting">void gdk_color_free (<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre><p>Frees a color structure created with <a class="link" href="gdk-Colormaps-and-Colors.html#gdk-color-copy"><code class="function">gdk_color_copy()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td><td> a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3148322"></a><h3><a name="gdk-colors-alloc"></a>gdk_colors_alloc ()</h3><a class="indexterm" name="id3148337"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> gdk_colors_alloc (<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> contiguous, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong">gulong</a> *planes, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> nplanes, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong">gulong</a> *pixels, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> npixels);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gdk_colors_alloc</code> is deprecated and should not be used in newly-written code.</p></div><p>Allocates colors from a colormap. This functionis obsolete. See <a class="link" href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-colors"><code class="function">gdk_colormap_alloc_colors()</code></a>.For full documentation of the fields, see the Xlib documentation for <code class="function"><code class="function">XAllocColorCells()</code></code>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td><td> a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>contiguous</code></em> :</span></p></td><td> if <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, the colors should be allocated in contiguous color cells.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>planes</code></em> :</span></p></td><td> an array in which to store the plane masks.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>nplanes</code></em> :</span></p></td><td> the number of planes to allocate. (Or zero, to indicate that the color allocation should not be planar.)</td></tr><tr><td><p><span class="term"><em class="parameter"><code>pixels</code></em> :</span></p></td><td> an array into which to store allocated pixel values.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>npixels</code></em> :</span></p></td><td> the number of pixels in each plane to allocate.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the allocation was successful</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3148579"></a><h3><a name="gdk-colors-free"></a>gdk_colors_free ()</h3><a class="indexterm" name="id3148594"></a><pre class="programlisting">void gdk_colors_free (<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong">gulong</a> *pixels, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> npixels, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong">gulong</a> planes);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gdk_colors_free</code> is deprecated and should not be used in newly-written code.</p></div><p>Frees colors allocated with <a class="link" href="gdk-Colormaps-and-Colors.html#gdk-colors-alloc"><code class="function">gdk_colors_alloc()</code></a>. Thisfunction is obsolete. See <a class="link" href="gdk-Colormaps-and-Colors.html#gdk-colormap-free-colors"><code class="function">gdk_colormap_free_colors()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td><td> a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>pixels</code></em> :</span></p></td><td> the pixel values of the colors to free.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>npixels</code></em> :</span></p></td><td> the number of values in <em class="parameter"><code>pixels</code></em>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>planes</code></em> :</span></p></td><td> the plane masks for all planes to free, OR'd together.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -