Skip to content

Gdk.MemoryTexture

class — extends Texture, Paintable, Gio.Icon, Gio.LoadableIcon

A GdkTexture representing image data in memory.

Constructors

new

@classmethod
def new(cls, width: int, height: int, format: MemoryFormat | int, bytes: bytes, stride: int) -> MemoryTexture

Creates a new texture for a blob of image data.

The GBytes must contain stride × height pixels in the given format.

Parameters:

  • width — the width of the texture
  • height — the height of the texture
  • format — the format of the data
  • bytes — the GBytes containing the pixel data
  • stride — rowstride for the data