gdk.texture

Module for [Texture] class

Types 3

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
GType _getGType() static nothrow
GType _gType() @property nothrow
Texture self() nothrowReturns `this`, for use in `with` statements.
TextureGidBuilder builder() static nothrowGet builder for [gdk.texture.Texture] Returns: New builder object
int height() @property nothrowGet `height` property. Returns: The height of the texture, in pixels.
int width() @property nothrowGet `width` property. Returns: The width of the texture, in pixels.
gdk.texture.Texture newForPixbuf(gdkpixbuf.pixbuf.Pixbuf pixbuf) static nothrowCreates a new texture object representing the [gdkpixbuf.pixbuf.Pixbuf].
gdk.texture.Texture newFromBytes(glib.bytes.Bytes bytes) staticCreates a new texture by loading an image from memory,
gdk.texture.Texture newFromFile(gio.file.File file) staticCreates a new texture by loading an image from a file.
gdk.texture.Texture newFromFilename(string path) staticCreates a new texture by loading an image from a file.
gdk.texture.Texture newFromResource(string resourcePath) static nothrowCreates a new texture by loading an image from a resource.
gdk.types.MemoryFormat getFormat() nothrowGets the memory format most closely associated with the data of the texture.
int getHeight() nothrowReturns the height of the texture, in pixels. Returns: the height of the [gdk.texture.Texture]
int getWidth() nothrowReturns the width of texture, in pixels. Returns: the width of the [gdk.texture.Texture]
bool saveToPng(string filename) nothrowStore the given texture to the filename as a PNG file.
glib.bytes.Bytes saveToPngBytes() nothrowStore the given texture in memory as a PNG file.
bool saveToTiff(string filename) nothrowStore the given texture to the filename as a TIFF file.
glib.bytes.Bytes saveToTiffBytes() nothrowStore the given texture in memory as a TIFF file.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for gdk.texture.Texture

Methods
T height(int propval) nothrowSet `height` property. Params: propval = The height of the texture, in pixels. Returns: Builder instance for fluent chaining
T width(int propval) nothrowSet `width` property. Params: propval = The width of the texture, in pixels. Returns: Builder instance for fluent chaining

Fluent builder for gdk.texture.Texture

Methods
Texture build() nothrowCreate object from builder. Returns: New object