Package: gdk

Function gdk:pixbuf-from-surface

Lambda List

gdk:pixbuf-from-surface (surface xsrc ysrc width height)

Arguments

surface -- a cairo:surface-t instance to copy from
xsrc -- an integer for the x coordinate within surface
ysrc -- an integer for the y coordinate within surface
width -- an integer for the width in pixels of the region to get
height -- an integer for the height in pixels of the region to get

Return Value

The newly created gdk-pixbuf:pixbuf object, or nil on error.

Details

Transfers image data from a cairo:surface-t instance and converts it to an RGB(A) representation inside a gdk-pixbuf:pixbuf object. This allows you to efficiently read individual pixels from Cairo surfaces. For gdk:window objects, use the gdk:pixbuf-from-window function instead.

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

See also

#2025-3-9