Pixbuf.newFromResource

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

The file format is detected automatically.

  1. Pixbuf newFromResource(string resourcePath)
    class Pixbuf
    static
    newFromResource
    ()
  2. Pixbuf newFromResource(string resourcePath, int width, int height, bool preserveAspectRatio)

Parameters

resourcePath string

the path of the resource file

Return: A newly-created pixbuf, or null if any of several error conditions occurred: the file could not be opened, the image format is not supported, there was not enough memory to allocate the image buffer, the stream contained invalid data, or the operation was cancelled.

Throws

GException on failure.

Meta

Since

2.26