Image.newFromResource
gtk.image.Image newFromResource(string resourcePath)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 [gdkpixbuf.pixbuf.Pixbuf.newFromFile] to load the file yourself, then create the #GtkImage from the pixbuf. (Or for animations, use [gdkpixbuf.pixbuf_animation.PixbufAnimation.newFromFile]).
The storage type ([gtk.image.Image.getStorageType]) of the returned image is not defined, it will be whatever is appropriate for displaying the file.
Parameters
resourcePath | a resource path |
Returns
a new #GtkImage