Image.from_pixbuf


Description:

[ CCode ( has_construct_function = false , type = "GtkWidget*" ) ]
[ Version ( deprecated = true , deprecated_since = "4.12" ) ]
public Image.from_pixbuf (Pixbuf? pixbuf)

Warning: Image.from_pixbuf is deprecated since 4.12.

Creates a new `GtkImage` displaying pixbuf.

Note:

Use [ctor@Gtk.Image.new_from_paintable] and [ctor@Gdk.Texture.new_for_pixbuf] instead

The `GtkImage` does not assume a reference to the pixbuf; you still need to unref it if you own references. `GtkImage` will add its own reference rather than adopting yours.

This is a helper for [ctor@Gtk.Image.new_from_paintable], and you can't get back the exact pixbuf once this is called, only a texture.

Note that this function just creates an `GtkImage` from the pixbuf. The `GtkImage` created will not react to state changes. Should you want that, you should use [ctor@Gtk.Image.new_from_icon_name].

Parameters:

pixbuf

a `GdkPixbuf`

Returns:

a new `GtkImage`