read_pixels


Description:

[ CCode ( array_length = false ) ]
public uint8[] read_pixels (int x, int y, int width = -1, int height = -1)

Makes a screenshot of the stage in RGBA 8bit data, returns a linear buffer with width * 4 as rowstride.

The alpha data contained in the returned buffer is driver-dependent, and not guaranteed to hold any sensible value.

Parameters:

this

A Stage

x

x coordinate of the first pixel that is read from stage

y

y coordinate of the first pixel that is read from stage

width

Width dimention of pixels to be read, or -1 for the entire stage width

height

Height dimention of pixels to be read, or -1 for the entire stage height

Returns:

a pointer to newly allocated memory with the buffer or null if the read failed. Use g_free on the returned data to release the resources it has allocated.