Constructor

GtkImagenew_from_resource

since: 3.4

Declaration [src]

GtkWidget*
gtk_image_new_from_resource (
  const gchar* resource_path
)

Description [src]

Creates a new GtkImage displaying the resource file resource_path. If the file isn’t found or can’t be loaded, the resulting GtkImage will display a “broken image” icon. This function never returns NULL, it always returns a valid GtkImage widget.

If the file contains an animation, the image will contain an animation.

If you need to detect failures to load the file, use gdk_pixbuf_new_from_file() to load the file yourself, then create the GtkImage from the pixbuf. (Or for animations, use gdk_pixbuf_animation_new_from_file()).

The storage type (gtk_image_get_storage_type()) of the returned image is not defined, it will be whatever is appropriate for displaying the file.

Available since: 3.4

Parameters

resource_path

Type: const gchar*

A resource path.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: GtkWidget

A new GtkImage.

The data is owned by the called function.