Package: gdk

Function gdk-pixbuf-from-surface

Lambda List

gdk-pixbuf-from-surface (surface src-x src-y width height)

Arguments

surface -- a cairo-surface-t instance to copy from
src-x -- an integer with the source x coordinate within surface
src-y -- an integer with the source y coordinate within surface
width -- an integer with width in pixels of region to get
height -- an integer with the height in pixels of region to get

Return Value

A newly-created gdk-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 object. This allows you to efficiently read individual pixels from cairo surfaces. For gdk-window objects, use the function gdk-pixbuf-from-window 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

2020-11-10