Texture

constructor(pixbuf: <Error class: unknown class>)

Creates a new texture object representing the GdkPixbuf.

This function is threadsafe, so that you can e.g. use GTask and method@Gio.Task.run_in_thread to avoid blocking the main thread while loading a big image.

Return

a new GdkTexture

Parameters

pixbuf

a GdkPixbuf


constructor(bytes: <Error class: unknown class>)

Creates a new texture by loading an image from memory,

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

If null is returned, then @error will be set.

This function is threadsafe, so that you can e.g. use GTask and method@Gio.Task.run_in_thread to avoid blocking the main thread while loading a big image.

Return

A newly-created GdkTexture

Since

4.6

Parameters

bytes

a GBytes containing the data to load


constructor(file: <Error class: unknown class>)

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

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

If null is returned, then @error will be set.

This function is threadsafe, so that you can e.g. use GTask and method@Gio.Task.run_in_thread to avoid blocking the main thread while loading a big image.

Return

A newly-created GdkTexture

Parameters

file

GFile to load


constructor(path: String)

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

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

If null is returned, then @error will be set.

This function is threadsafe, so that you can e.g. use GTask and method@Gio.Task.run_in_thread to avoid blocking the main thread while loading a big image.

Return

A newly-created GdkTexture

Since

4.6

Parameters

path

the filename to load


constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)