Texture.newFromResource

Creates a new texture by loading an image from a resource.

The file format is detected automatically. The supported formats are PNG and JPEG, though more formats might be available.

It is a fatal error if resource_path does not specify a valid image resource and the program will abort if that happens. If you are unsure about the validity of a resource, use gdk.texture.Texture.newFromFile to load it.

This function is threadsafe, so that you can e.g. use GTask and gio.task.Task.runInThread to avoid blocking the main thread while loading a big image.

class Texture
static
newFromResource
()

Parameters

resourcePath string

the path of the resource file

Return Value

Type: gdk.texture.Texture

A newly-created gdk.texture.Texture