📄 gdk-drawing-primitives.html
字号:
<p></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></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103594"></a><h3><a name="gdk-drawable-set-colormap"></a>gdk_drawable_set_colormap ()</h3><a class="indexterm" name="id3103608"></a><pre class="programlisting">void gdk_drawable_set_colormap (<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);</pre><p>Sets the colormap associated with <em class="parameter"><code>drawable</code></em>. Normally this willhappen automatically when the drawable is created; you only need touse this function if the drawable-creating function did not have away to determine the colormap, and you then use drawable operationsthat require a colormap. The colormap for all drawables andgraphics contexts you intend to use together should match. i.e.when using a <a class="link" href="gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> to draw to a drawable, or copying one drawableto another, the colormaps should match.</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>drawable</code></em> :</span></p></td><td> a <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a></td></tr><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></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103716"></a><h3><a name="gdk-drawable-get-colormap"></a>gdk_drawable_get_colormap ()</h3><a class="indexterm" name="id3103730"></a><pre class="programlisting"><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a>* gdk_drawable_get_colormap (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable);</pre><p>Gets the colormap for <em class="parameter"><code>drawable</code></em>, if one is set; returns<ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> otherwise.</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>drawable</code></em> :</span></p></td><td> a <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the colormap, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103824"></a><h3><a name="gdk-drawable-get-depth"></a>gdk_drawable_get_depth ()</h3><a class="indexterm" name="id3103837"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> gdk_drawable_get_depth (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable);</pre><p>Obtains the bit depth of the drawable, that is, the number of bitsthat make up a pixel in the drawable's visual. Examples are 8 bitsper pixel, 24 bits per pixel, etc.</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>drawable</code></em> :</span></p></td><td> a <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> number of bits per pixel</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103908"></a><h3><a name="gdk-drawable-get-size"></a>gdk_drawable_get_size ()</h3><a class="indexterm" name="id3103921"></a><pre class="programlisting">void gdk_drawable_get_size (<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);</pre><p>Fills *<em class="parameter"><code>width</code></em> and *<em class="parameter"><code>height</code></em> with the size of <em class="parameter"><code>drawable</code></em>.<em class="parameter"><code>width</code></em> or <em class="parameter"><code>height</code></em> can be <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if you only want the other one.</p><p>On the X11 platform, if <em class="parameter"><code>drawable</code></em> is a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a>, the returnedsize is the size reported in the most-recently-processed configureevent, rather than the current size on the X server.</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>drawable</code></em> :</span></p></td><td> a <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td><td> location to store drawable's width, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td><td> location to store drawable's height, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104103"></a><h3><a name="gdk-drawable-get-clip-region"></a>gdk_drawable_get_clip_region ()</h3><a class="indexterm" name="id3104117"></a><pre class="programlisting"><a class="link" href="gdk-Points-Rectangles-and-Regions.html#GdkRegion">GdkRegion</a>* gdk_drawable_get_clip_region (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable);</pre><p>Computes the region of a drawable that potentially can be writtento by drawing primitives. This region will not take into accountthe clip region for the GC, and may also not take into accountother factors such as if the window is obscured by other windows,but no area outside of this region will be affected by drawingprimitives.</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>drawable</code></em> :</span></p></td><td> a <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="gdk-Points-Rectangles-and-Regions.html#GdkRegion"><span class="type">GdkRegion</span></a>. This must be freed with <a class="link" href="gdk-Points-Rectangles-and-Regions.html#gdk-region-destroy"><code class="function">gdk_region_destroy()</code></a> when you are done.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104210"></a><h3><a name="gdk-drawable-get-visible-region"></a>gdk_drawable_get_visible_region ()</h3><a class="indexterm" name="id3104223"></a><pre class="programlisting"><a class="link" href="gdk-Points-Rectangles-and-Regions.html#GdkRegion">GdkRegion</a>* gdk_drawable_get_visible_region (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable);</pre><p>Computes the region of a drawable that is potentially visible.This does not necessarily take into account if the window isobscured by other windows, but no area outside of this regionis visible.</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>drawable</code></em> :</span></p></td><td> a <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="gdk-Points-Rectangles-and-Regions.html#GdkRegion"><span class="type">GdkRegion</span></a>. This must be freed with <a class="link" href="gdk-Points-Rectangles-and-Regions.html#gdk-region-destroy"><code class="function">gdk_region_destroy()</code></a> when you are done.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3104314"></a><h3><a name="gdk-draw-point"></a>gdk_draw_point ()</h3><a class="indexterm" name="id3104326"></a><pre class="programlisting">void gdk_draw_point (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable, <a class="link" href="gdk-Graphics-Contexts.html#GdkGC">GdkGC</a> *gc, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> x,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -