Texture
GdkTexture
is the basic element used to refer to pixel data.
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.
Skipped during bindings generation
parameter
data
: Array parameter of type guint8 is not supported
Inheritors
Constructors
Creates a new texture object representing the GdkPixbuf
.
Creates a new texture by loading an image from memory,
Creates a new texture by loading an image from a file.
Creates a new texture by loading an image from a file.
Properties
Functions
Emitted when the contents of the @paintable change.
Emitted when the intrinsic size of the @paintable changes.
Gets an immutable paintable for the current contents displayed by @paintable.
Get flags for the paintable.
Gets the memory format most closely associated with the data of the texture.
Gets the preferred aspect ratio the @paintable would like to be displayed at.
Gets the preferred height the @paintable would like to be displayed at.
Gets the preferred width the @paintable would like to be displayed at.
Called by implementations of GdkPaintable
to invalidate their contents.
Called by implementations of GdkPaintable
to invalidate their size.
Store the given @texture in memory as a PNG file.
Store the given @texture to the @filename as a TIFF file.
Store the given @texture in memory as a TIFF file.