pixbufGetFromSurface

fngdkpixbuf.pixbuf.Pixbuf pixbufGetFromSurface(cairo.surface.Surface surface, int srcX, int srcY, int width, int height)

Transfers image data from a [cairo.surface.Surface] and converts it to a [gdkpixbuf.pixbuf.Pixbuf].

This allows you to efficiently read individual pixels from cairo surfaces.

This function will create an RGB pixbuf with 8 bits per channel. The pixbuf will contain an alpha channel if the surface contains one.

Parameters

surfacesurface to copy from
srcXSource X coordinate within surface
srcYSource Y coordinate within surface
widthWidth in pixels of region to get
heightHeight in pixels of region to get

Returns

A newly-created pixbuf with a

reference count of 1

Deprecated

Use [gdk.texture.Texture] and subclasses instead

cairo surfaces and pixbufs