gdk.texture
Module for [Texture] class
Types 3
classTexture : gobject.object.ObjectWrap, gdk.paintable.Paintable, gio.icon.Icon, gio.loadable_icon.LoadableIcon
[gdk.texture.Texture] 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 [gdk.texture.Texture] objects from a [gdkpixbuf.pixbuf.Pixbuf], or from bytes stored in memory, a file, or a [gio.resource.Resource].
The ownership of the pixel data is transferred to the [gdk.texture.Texture] instance; you can only make a copy of it, via [gdk.texture.Texture.download].
[gdk.texture.Texture] is an immutable object: That means you cannot change anything about it other than increasing the reference count via [gobject.object.ObjectWrap.ref_], and consequently, it is a thread-safe object.
Methods
TextureGidBuilder builder()Get builder for [gdk.texture.Texture] Returns: New builder objectgdk.texture.Texture newForPixbuf(gdkpixbuf.pixbuf.Pixbuf pixbuf)Creates a new texture object representing the [gdkpixbuf.pixbuf.Pixbuf].gdk.texture.Texture newFromBytes(glib.bytes.Bytes bytes)Creates a new texture by loading an image from memory,gdk.texture.Texture newFromFile(gio.file.File file)Creates a new texture by loading an image from a file.gdk.texture.Texture newFromFilename(string path)Creates a new texture by loading an image from a file.gdk.texture.Texture newFromResource(string resourcePath)Creates a new texture by loading an image from a resource.gdk.types.MemoryFormat getFormat()Gets the memory format most closely associated with the data of the texture.int getHeight()Returns the height of the texture, in pixels. Returns: the height of the [gdk.texture.Texture]int getWidth()Returns the width of texture, in pixels. Returns: the width of the [gdk.texture.Texture]bool saveToPng(string filename)Store the given texture to the filename as a PNG file.glib.bytes.Bytes saveToPngBytes()Store the given texture in memory as a PNG file.bool saveToTiff(string filename)Store the given texture to the filename as a TIFF file.glib.bytes.Bytes saveToTiffBytes()Store the given texture in memory as a TIFF file.