gdk-gdkrgb.html

来自「最新gtk中文资料集」· HTML 代码 · 共 1,455 行 · 第 1/5 页

HTML
1,455
字号
<a name="id3128873"></a><h3><a name="gdk-rgb-find-color"></a>gdk_rgb_find_color ()</h3><a class="indexterm" name="id3128886"></a><pre class="programlisting">void                gdk_rgb_find_color                  (<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> *color);</pre><p><em class="parameter"><code>colormap</code></em> should be the colormap for the graphics context anddrawable you're using to draw. If you're drawing to a <ahref="/usr/share/gtk-doc/html/gtk/GtkWidget.html"><span class="type">GtkWidget</span></a>,call <ahref="/usr/share/gtk-doc/html/gtk/GtkWidget.html#gtk-widget-get-colormap"><code class="function">gtk_widget_get_colormap()</code></a>.</p><p><em class="parameter"><code>color</code></em> should have its <code class="literal">red</code>, <code class="literal">green</code>, and <code class="literal">blue</code> fields initialized;<a class="link" href="gdk-GdkRGB.html#gdk-rgb-find-color"><code class="function">gdk_rgb_find_color()</code></a> will fill in the <code class="literal">pixel</code> field with the bestmatching pixel from a color cube. The color is then ready to beused for drawing, e.g. you can call <a class="link" href="gdk-Graphics-Contexts.html#gdk-gc-set-foreground"><code class="function">gdk_gc_set_foreground()</code></a> whichexpects <code class="literal">pixel</code> to be initialized.</p><p>In many cases, you can avoid this whole issue by calling<a class="link" href="gdk-Graphics-Contexts.html#gdk-gc-set-rgb-fg-color"><code class="function">gdk_gc_set_rgb_fg_color()</code></a> or <a class="link" href="gdk-Graphics-Contexts.html#gdk-gc-set-rgb-bg-color"><code class="function">gdk_gc_set_rgb_bg_color()</code></a>, whichdo not expect <code class="literal">pixel</code> to be initialized in advance. If you use thosefunctions, there's no need for <a class="link" href="gdk-GdkRGB.html#gdk-rgb-find-color"><code class="function">gdk_rgb_find_color()</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>&#160;:</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>color</code></em>&#160;:</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="id3129139"></a><h3><a name="gdk-rgb-set-install"></a>gdk_rgb_set_install ()</h3><a class="indexterm" name="id3129152"></a><pre class="programlisting">void                gdk_rgb_set_install                 (<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> install);</pre><p>If <em class="parameter"><code>install</code></em> is <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, directs GdkRGB to always install a new "private"colormap rather than trying to find a best fit with the colors alreadyallocated. Ordinarily, GdkRGB will install a colormap only if asufficient cube cannot be allocated.</p><p>A private colormap has more colors, leading to better quality display,but also leads to the dreaded "colormap flashing" effect.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>install</code></em>&#160;:</span></p></td><td><ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to set install mode.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3129233"></a><h3><a name="gdk-rgb-set-min-colors"></a>gdk_rgb_set_min_colors ()</h3><a class="indexterm" name="id3129246"></a><pre class="programlisting">void                gdk_rgb_set_min_colors              (<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> min_colors);</pre><p>Sets the minimum number of colors for the color cube. Generally,GdkRGB tries to allocate the largest color cube it can. If it can'tallocate a color cube at least as large as <em class="parameter"><code>min_colors</code></em>, it installs aprivate colormap.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>min_colors</code></em>&#160;:</span></p></td><td>The minimum number of colors accepted.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3129303"></a><h3><a name="gdk-rgb-get-visual"></a>gdk_rgb_get_visual ()</h3><a class="indexterm" name="id3129316"></a><pre class="programlisting"><a class="link" href="gdk-Visuals.html#GdkVisual">GdkVisual</a>*          gdk_rgb_get_visual                  (void);</pre><p>Gets a "preferred visual" chosen by GdkRGB for rendering image dataon the default screen. In previous versions of GDK, this was theonly visual GdkRGB could use for rendering. In current versions,it's simply the visual GdkRGB would have chosen as the optimal onein those previous versions. GdkRGB can now render to drawables withany visual.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> The <a class="link" href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></a> chosen by GdkRGB.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3124990"></a><h3><a name="gdk-rgb-get-colormap"></a>gdk_rgb_get_colormap ()</h3><a class="indexterm" name="id3125003"></a><pre class="programlisting"><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a>*        gdk_rgb_get_colormap                (void);</pre><p>Get the preferred colormap for rendering image data.  Not avery useful function; historically, GDK could only render RGB imagedata to one colormap and visual, but in the current version it canrender to any colormap and visual. So there's no need to call thisfunction.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> the preferred colormap</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3125048"></a><h3><a name="gdk-rgb-get-cmap"></a>gdk_rgb_get_cmap</h3><a class="indexterm" name="id3125062"></a><pre class="programlisting">#define gdk_rgb_get_cmap               gdk_rgb_get_colormap</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gdk_rgb_get_cmap</code> is deprecated and should not be used in newly-written code.</p></div><p>Gets the colormap set by GdkRGB. This colormap and the correspondingvisual should be used when creating windows that will be drawn in by GdkRGB.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>The <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a> set by GdkRGB.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3129631"></a><h3><a name="gdk-rgb-ditherable"></a>gdk_rgb_ditherable ()</h3><a class="indexterm" name="id3129644"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gdk_rgb_ditherable                  (void);</pre><p>Determines whether the preferred visual is ditherable. This function may beuseful for presenting a user interface choice to the user about whichdither mode is desired; if the display is not ditherable, it may makesense to gray out or hide the corresponding UI widget.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</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 preferred visual is ditherable.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3129694"></a><h3><a name="gdk-rgb-colormap-ditherable"></a>gdk_rgb_colormap_ditherable ()</h3><a class="indexterm" name="id3129708"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gdk_rgb_colormap_ditherable         (<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *cmap);</pre><p>Determines whether the visual associated with <em class="parameter"><code>cmap</code></em> is ditherable. This function may be useful for presenting a user interface choice to the user about which dither mode is desired; if the display is not ditherable, it may make sense to gray out or hide the corresponding UI widget.</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>&#160;:</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>&#160;:</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 visual associated with <em class="parameter"><code>cmap</code></em> is ditherable.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3129798"></a><h3><a name="gdk-rgb-set-verbose"></a>gdk_rgb_set_verbose ()</h3><a class="indexterm" name="id3129812"></a><pre class="programlisting">void                gdk_rgb_set_verbose                 (<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> verbose);</pre><p>Sets the "verbose" flag. This is generally only useful for debugging.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>verbose</code></em>&#160;:</span></p></td><td><ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if verbose messages are desired.</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3129870"></a><h2>See Also</h2><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a></span></p></td><td><p>The underlying GDK mechanism for allocatingcolors.</p></td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> and <a class="link" href="gdk-Drawing-Primitives.html#gdk-draw-pixbuf"><code class="function">gdk_draw_pixbuf()</code></a></span></p></td><td><p>Higher-level image handling.</p></td></tr></tbody></table></div><p></p></div><div class="refsect1" lang="en"><a name="id3129927"></a><div class="refsect2" lang="en"><a name="id3129928"></a></div><hr><div class="refsect2" lang="en"><a name="id3129930"></a></div></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?