Texture


Object Hierarchy:

Gdk.Texture Gdk.Texture Gdk.Texture GLib.Object GLib.Object GLib.Object->Gdk.Texture Gdk.Paintable Gdk.Paintable Gdk.Paintable->Gdk.Texture GLib.Icon GLib.Icon GLib.Icon->Gdk.Texture GLib.LoadableIcon GLib.LoadableIcon GLib.LoadableIcon->Gdk.Texture

Description:

[ CCode ( type_id = "gdk_texture_get_type ()" ) ]
public abstract class Texture : Object, Paintable, Icon, LoadableIcon

Refers to pixel data in various forms.

It is primarily meant for pixel data that will not change over multiple frames, and will be used for a long time.

There are various ways to create `GdkTexture` objects from a [class@GdkPixbuf.Pixbuf], or from bytes stored in memory, a file, or a [ struct@Gio.Resource].

The ownership of the pixel data is transferred to the `GdkTexture` instance; you can only make a copy of it, via [method@Gdk.Texture.download].

`GdkTexture` is an immutable object: That means you cannot change anything about it other than increasing the reference count via [ method@GObject.Object.ref], and consequently, it is a threadsafe object.

GDK provides a number of threadsafe texture loading functions: [ctor@Gdk.Texture.new_from_resource], [ctor@Gdk.Texture.new_from_bytes], [ ctor@Gdk.Texture.new_from_file], [ctor@Gdk.Texture.new_from_filename], [ctor@Gdk.Texture.new_for_pixbuf]. Note that these are meant for loading icons and resources that are shipped with the toolkit or application. It is recommended that you use a dedicated image loading framework such as glycin, if you need to load untrusted image data.

All known sub-classes:

Namespace: Gdk
Package: gtk4

Content:

Properties:

Static methods:

Creation methods:

Methods:

Inherited Members:

All known members inherited from interface GLib.Icon
All known members inherited from interface GLib.LoadableIcon