📄 gtkimage.html
字号:
The <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> does not assume a reference to thepixbuf; 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>Note that this function just creates an <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> from the pixbuf. The<a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> created will not react to state changes. Should you want that, you should use <a class="link" href="GtkImage.html#gtk-image-new-from-icon-set"><code class="function">gtk_image_new_from_icon_set()</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>pixbuf</code></em> :</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</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> :</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="id3442937"></a><h3><a name="gtk-image-new-from-pixmap"></a>gtk_image_new_from_pixmap ()</h3><a class="indexterm" name="id3442951"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_image_new_from_pixmap (<ahref="/usr/share/gtk-doc/html/gdk/gdk-Bitmaps-and-Pixmaps.html#GdkPixmap">GdkPixmap</a> *pixmap, <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 <em class="parameter"><code>pixmap</code></em> with a <em class="parameter"><code>mask</code></em>.A <ahref="/usr/share/gtk-doc/html/gdk/gdk-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a> is a server-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 thepixmap 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>pixmap</code></em> :</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/gdk/gdk-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</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> :</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> :</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="id3443123"></a><h3><a name="gtk-image-new-from-stock"></a>gtk_image_new_from_stock ()</h3><a class="indexterm" name="id3443136"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_image_new_from_stock (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *stock_id, <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 a stock icon. Sample stock iconnames are <a class="link" href="gtk-Stock-Items.html#GTK-STOCK-OPEN:CAPS"><span class="type">GTK_STOCK_OPEN</span></a>, <a class="link" href="gtk-Stock-Items.html#GTK-STOCK-QUIT:CAPS"><span class="type">GTK_STOCK_QUIT</span></a>. Sample stock sizesare <span class="type">GTK_ICON_SIZE_MENU</span>, <span class="type">GTK_ICON_SIZE_SMALL_TOOLBAR</span>. If the stockicon name isn't known, the image will be empty.You can register your own stock icon names, see<a class="link" href="gtk-Themeable-Stock-Images.html#gtk-icon-factory-add-default"><code class="function">gtk_icon_factory_add_default()</code></a> and <a class="link" href="gtk-Themeable-Stock-Images.html#gtk-icon-factory-add"><code class="function">gtk_icon_factory_add()</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>stock_id</code></em> :</span></p></td><td> a stock icon name</td></tr><tr><td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td><td> a stock icon size</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="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> displaying the stock icon</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3443294"></a><h3><a name="gtk-image-new-from-animation"></a>gtk_image_new_from_animation ()</h3><a class="indexterm" name="id3443307"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_image_new_from_animation (<ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-animation.html#GdkPixbufAnimation">GdkPixbufAnimation</a> *animation);</pre><p>Creates a <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> displaying the given animation.The <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> does not assume a reference to theanimation; 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>Note that the animation frames are shown using a timeout with<ahref="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT:CAPS"><span class="type">G_PRIORITY_DEFAULT</span></a>. When using animations to indicate busyness,keep in mind that the animation will only be shown if the main loopis not busy with something that has a higher priority.</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>animation</code></em> :</span></p></td><td> an animation</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="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> widget</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3443420"></a><h3><a name="gtk-image-new-from-icon-name"></a>gtk_image_new_from_icon_name ()</h3><a class="indexterm" name="id3443435"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_image_new_from_icon_name (const <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>Creates a <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> displaying an icon from the current icon theme.If the icon name isn't known, a "broken image" icon will bedisplayed instead. If the current icon theme is changed, the iconwill be updated appropriately.</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_name</code></em> :</span></p></td><td> an icon name</td></tr><tr><td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td><td> a stock icon size</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="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> displaying the themed icon</td></tr></tbody></table></div><p class="since">Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3443544"></a><h3><a name="gtk-image-set-from-file"></a>gtk_image_set_from_file ()</h3><a class="indexterm" name="id3443557"></a><pre class="programlisting">void gtk_image_set_from_file (<a class="link" href="GtkImage.html" title="GtkImage">GtkImage</a> *image, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *filename);</pre><p>See <a class="link" href="GtkImage.html#gtk-image-new-from-file"><code class="function">gtk_image_new_from_file()</code></a> for details.</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> :</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>filename</code></em> :</span></p></td><td> a filename 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="id3443658"></a><h3><a name="gtk-image-set-from-icon-set"></a>gtk_image_set_from_icon_set ()</h3><a class="indexterm" name="id3443672"></a><pre class="programlisting">void gtk_image_set_from_icon_set (<a class="link" href="GtkImage.html" title="GtkImage">GtkImage</a> *image, <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a> *icon_set, <a class=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -