readImage

fnubyte * readImage(ubyte * buf, int x, int y, int w, int h, bool alpha = false) nothrow @nogc

Reads pixels from the current window into a buffer.

If buf is null, a new buffer will be allocated.

Parameters

bufBuffer to store pixels (or null to allocate)
xX coordinate
yY coordinate
wWidth in pixels
hHeight in pixels
alphaInclude alpha channel (true for RGBA, false for RGB)

Returns

Pointer to pixel data, or null on failure