📄 gdk-images.html
字号:
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135202"></a><h3><a name="gdk-image-new"></a>gdk_image_new ()</h3><a class="indexterm" name="id3135215"></a><pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage">GdkImage</a>* gdk_image_new (<a class="link" href="gdk-Images.html#GdkImageType">GdkImageType</a> type, <a class="link" href="gdk-Visuals.html#GdkVisual">GdkVisual</a> *visual, <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>Creates a new <a class="link" href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td><td>the type of the <a class="link" href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>, one of <a class="link" href="gdk-Images.html#GDK-IMAGE-NORMAL:CAPS"><code class="literal">GDK_IMAGE_NORMAL</code></a>, <a class="link" href="gdk-Images.html#GDK-IMAGE-SHARED:CAPS"><code class="literal">GDK_IMAGE_SHARED</code></a>and <a class="link" href="gdk-Images.html#GDK-IMAGE-FASTEST:CAPS"><code class="literal">GDK_IMAGE_FASTEST</code></a>. <a class="link" href="gdk-Images.html#GDK-IMAGE-FASTEST:CAPS"><code class="literal">GDK_IMAGE_FASTEST</code></a> is probably the best choice, sinceit will try creating a <a class="link" href="gdk-Images.html#GDK-IMAGE-SHARED:CAPS"><code class="literal">GDK_IMAGE_SHARED</code></a> image first and if that fails it willthen use <a class="link" href="gdk-Images.html#GDK-IMAGE-NORMAL:CAPS"><code class="literal">GDK_IMAGE_NORMAL</code></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>visual</code></em> :</span></p></td><td>the <a class="link" href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></a> to use for the image.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td><td>the width of the image 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 image in pixels.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if the image could not be created.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135450"></a><h3><a name="GdkImageType"></a>enum GdkImageType</h3><a class="indexterm" name="id3135463"></a><pre class="programlisting">typedef enum{ GDK_IMAGE_NORMAL, GDK_IMAGE_SHARED, GDK_IMAGE_FASTEST} GdkImageType;</pre><p>Specifies the type of a <a class="link" href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="GDK-IMAGE-NORMAL:CAPS"></a><code class="literal">GDK_IMAGE_NORMAL</code></span></p></td><td>The original X image type, which is quite slow since theimage has to be transferred from the client to the server to display it.</td></tr><tr><td><p><span class="term"><a name="GDK-IMAGE-SHARED:CAPS"></a><code class="literal">GDK_IMAGE_SHARED</code></span></p></td><td>A faster image type, which uses shared memory to transferthe image data between client and server. However this will only be availableif client and server are on the same machine and the shared memory extensionis supported by the server.</td></tr><tr><td><p><span class="term"><a name="GDK-IMAGE-FASTEST:CAPS"></a><code class="literal">GDK_IMAGE_FASTEST</code></span></p></td><td>Specifies that <a class="link" href="gdk-Images.html#GDK-IMAGE-SHARED:CAPS"><code class="literal">GDK_IMAGE_SHARED</code></a> should be tried first,and if that fails then <a class="link" href="gdk-Images.html#GDK-IMAGE-NORMAL:CAPS"><code class="literal">GDK_IMAGE_NORMAL</code></a> will be used.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135586"></a><h3><a name="gdk-image-new-bitmap"></a>gdk_image_new_bitmap ()</h3><a class="indexterm" name="id3135601"></a><pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage">GdkImage</a>* gdk_image_new_bitmap (<a class="link" href="gdk-Visuals.html#GdkVisual">GdkVisual</a> *visual, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</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);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gdk_image_new_bitmap</code> is deprecated and should not be used in newly-written code.</p></div><p>Creates a new <a class="link" href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a> with a depth of 1 from the given data.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>THIS FUNCTION IS INCREDIBLY BROKEN. The passed-in data must be allocated by <code class="function">malloc()</code> (NOT <ahref="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-malloc"><code class="function">g_malloc()</code></a>) and will be freed when the image is freed.</p></div><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>visual</code></em> :</span></p></td><td> the <a class="link" href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></a> to use for the image.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td><td> the pixel data. </td></tr><tr><td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td><td> the width of the image 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 image in pixels. </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3135794"></a><h3><a name="gdk-image-get"></a>gdk_image_get ()</h3><a class="indexterm" name="id3135809"></a><pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage">GdkImage</a>* gdk_image_get (<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> x, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> y, <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><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gdk_image_get</code> is deprecated and should not be used in newly-written code.</p></div><p>This is a deprecated wrapper for <a class="link" href="gdk-Drawing-Primitives.html#gdk-drawable-get-image"><code class="function">gdk_drawable_get_image()</code></a>;<a class="link" href="gdk-Drawing-Primitives.html#gdk-drawable-get-image"><code class="function">gdk_drawable_get_image()</code></a> should be used instead. Or even better: inmost cases <a class="link" href="gdk-Pixbufs.html#gdk-pixbuf-get-from-drawable"><code class="function">gdk_pixbuf_get_from_drawable()</code></a> is the most convenientchoice.</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>x</code></em> :</span></p></td><td> x coordinate in <em class="parameter"><code>window</code></em></td></tr><tr><td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td><td> y coordinate in <em class="parameter"><code>window</code></em></td></tr><tr><td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td><td> width of area in <em class="parameter"><code>window</code></em></td></tr><tr><td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td><td> height of area in <em class="parameter"><code>window</code></em></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a> 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="id3136052"></a><h3><a name="gdk-image-ref"></a>gdk_image_ref ()</h3><a class="indexterm" name="id3136067"></a><pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage">GdkImage</a>* gdk_image_ref (<a class="link" href="gdk-Images.html#GdkImage">GdkImage</a> *image);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gdk_image_ref</code> is deprecated and should not be used in newly-written code.</p></div><p>Deprecated function; use <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a> instead.</p><p></p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -