⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtkimage.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<tr><td><p><span class="term"><em class="parameter"><code>image</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> the displayed animation, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if the image is empty</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3441926"></a><h3><a name="gtk-image-get-icon-name"></a>gtk_image_get_icon_name ()</h3><a class="indexterm" name="id3441942"></a><pre class="programlisting">void                gtk_image_get_icon_name             (<a class="link" href="GtkImage.html" title="GtkImage">GtkImage</a> *image,                                                         G_CONST_RETURN <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> **icon_name,                                                         <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSize">GtkIconSize</a> *size);</pre><p>Gets the icon name and size being displayed by the <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a>.The storage type of the image must be <a class="link" href="GtkImage.html#GTK-IMAGE-EMPTY:CAPS"><code class="literal">GTK_IMAGE_EMPTY</code></a> or<a class="link" href="GtkImage.html#GTK-IMAGE-ICON-NAME:CAPS"><code class="literal">GTK_IMAGE_ICON_NAME</code></a> (see <a class="link" href="GtkImage.html#gtk-image-get-storage-type"><code class="function">gtk_image_get_storage_type()</code></a>).The returned string is owned by the <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> and should notbe freed.</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>image</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>icon_name</code></em>&#160;:</span></p></td><td> place to store an icon name</td></tr><tr><td><p><span class="term"><em class="parameter"><code>size</code></em>&#160;:</span></p></td><td> place to store an icon size</td></tr></tbody></table></div><p class="since">Since  2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3442102"></a><h3><a name="gtk-image-get-storage-type"></a>gtk_image_get_storage_type ()</h3><a class="indexterm" name="id3442116"></a><pre class="programlisting"><a class="link" href="GtkImage.html#GtkImageType">GtkImageType</a>        gtk_image_get_storage_type          (<a class="link" href="GtkImage.html" title="GtkImage">GtkImage</a> *image);</pre><p>Gets the type of representation being used by the <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a>to store image data. If the <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> has no image data,the return value will be <a class="link" href="GtkImage.html#GTK-IMAGE-EMPTY:CAPS"><code class="literal">GTK_IMAGE_EMPTY</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>image</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> image representation being used</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3442213"></a><h3><a name="gtk-image-new-from-file"></a>gtk_image_new_from_file ()</h3><a class="indexterm" name="id3442225"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_image_new_from_file             (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *filename);</pre><p>Creates a new <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> displaying the file <em class="parameter"><code>filename</code></em>. If the fileisn't found or can't be loaded, the resulting <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> willdisplay a "broken image" icon. This function never returns <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>,it always returns a valid <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> widget.</p><p>If the file contains an animation, the image will contain ananimation.</p><p>If you need to detect failures to load the file, use<ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-file-loading.html#gdk-pixbuf-new-from-file"><code class="function">gdk_pixbuf_new_from_file()</code></a> to load the file yourself, then createthe <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> from the pixbuf. (Or for animations, use<ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-animation.html#gdk-pixbuf-animation-new-from-file"><code class="function">gdk_pixbuf_animation_new_from_file()</code></a>).</p><p>The storage type (<a class="link" href="GtkImage.html#gtk-image-get-storage-type"><code class="function">gtk_image_get_storage_type()</code></a>) of the returnedimage is not defined, it will be whatever is appropriate fordisplaying the file.</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>filename</code></em>&#160;:</span></p></td><td> a filename</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> a new <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3442394"></a><h3><a name="gtk-image-new-from-icon-set"></a>gtk_image_new_from_icon_set ()</h3><a class="indexterm" name="id3442406"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_image_new_from_icon_set         (<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a> *icon_set,                                                         <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSize">GtkIconSize</a> size);</pre><p>Creates a <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> displaying an icon set. Sample stock sizes are<span class="type">GTK_ICON_SIZE_MENU</span>, <span class="type">GTK_ICON_SIZE_SMALL_TOOLBAR</span>. Instead of usingthis function, usually it's better to create a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory"><span class="type">GtkIconFactory</span></a>, putyour icon sets in the icon factory, add the icon factory to thelist of default factories with <a class="link" href="gtk-Themeable-Stock-Images.html#gtk-icon-factory-add-default"><code class="function">gtk_icon_factory_add_default()</code></a>, andthen use <a class="link" href="GtkImage.html#gtk-image-new-from-stock"><code class="function">gtk_image_new_from_stock()</code></a>. This will allow themes tooverride the icon you ship with your application.</p><p>The <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> does not assume a reference to theicon set; you still need to unref it if you own references.<a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> will add its own reference rather than adopting yours.</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>icon_set</code></em>&#160;:</span></p></td><td> a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>size</code></em>&#160;:</span></p></td><td> a stock icon size</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> a new <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3442587"></a><h3><a name="gtk-image-new-from-image"></a>gtk_image_new_from_image ()</h3><a class="indexterm" name="id3442600"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_image_new_from_image            (<ahref="/usr/share/gtk-doc/html/gdk/gdk-Images.html#GdkImage">GdkImage</a> *image,                                                         <ahref="/usr/share/gtk-doc/html/gdk/gdk-Bitmaps-and-Pixmaps.html#GdkBitmap">GdkBitmap</a> *mask);</pre><p>Creates a <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> widget displaying a <em class="parameter"><code>image</code></em> with a <em class="parameter"><code>mask</code></em>.A <ahref="/usr/share/gtk-doc/html/gdk/gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a> is a client-side image buffer in the pixel format of thecurrent display. The <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> does not assume a reference to theimage or mask; you still need to unref them if you own references.<a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> will add its own reference rather than adopting yours.</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>image</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/gdk/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><tr><td><p><span class="term"><em class="parameter"><code>mask</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/gdk/gdk-Bitmaps-and-Pixmaps.html#GdkBitmap"><span class="type">GdkBitmap</span></a>, 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"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> a new <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3442773"></a><h3><a name="gtk-image-new-from-pixbuf"></a>gtk_image_new_from_pixbuf ()</h3><a class="indexterm" name="id3442787"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_image_new_from_pixbuf           (<ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre><p>Creates a new <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> displaying <em class="parameter"><code>pixbuf</code></em>.

⌨️ 快捷键说明

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