Various kinds of object can be displayed as an image; most typically,
you would load a gdk.texture.Texture from a file, using the convenience function
gtk.image.Image.newFromFile, for instance:
gtk.image.Image displays its image as an icon, with a size that is determined
by the application. See gtk.picture.Picture if you want to show an image
at is actual size.
gtk.image.Image has a single CSS node with the name image. The style classes
.normal-icons or .large-icons may appear, depending on the
property@Gtk.Image:icon-size property.
The gtk.image.Image widget displays an image.
Various kinds of object can be displayed as an image; most typically, you would load a gdk.texture.Texture from a file, using the convenience function gtk.image.Image.newFromFile, for instance:
GtkWidget *image = gtk_image_new_from_file ("myfile.png");
If the file isn’t loaded successfully, the image will contain a “broken image” icon similar to that used in many web browsers.
If you want to handle errors in loading the file yourself, for example by displaying an error message, then load the image with gdk.texture.Texture.newFromFile, then create the gtk.image.Image with gtk.image.Image.newFromPaintable.
Sometimes an application will want to avoid depending on external data files, such as image files. See the documentation of gio.resource.Resource inside GIO, for details. In this case, gtk.image.Image.utf8, gtk.image.Image.newFromResource, and gtk.image.Image.setFromResource should be used.
gtk.image.Image displays its image as an icon, with a size that is determined by the application. See gtk.picture.Picture if you want to show an image at is actual size.
CSS nodes
gtk.image.Image has a single CSS node with the name image. The style classes .normal-icons or .large-icons may appear, depending on the property@Gtk.Image:icon-size property.
Accessibility
gtk.image.Image uses the gtk.types.AccessibleRole.Img role.