GLBasic User Manual

Main sections

GRABSPRITE

GRABSPRITE no%, x%, y%, width%, height%



Grabs a portion of the back buffer from location x%, y%, with width width% and height height%, and stores it as sprite no%.
This command is very handy for spilt screen programs or mirror effects as well as dynamical texture generation for 3D objects.

Sample:

FOR i=0 TO 256
DRAWLINE 0,i,256,i,RGB(0, i, 255-i)
NEXT

GRABSPRITE 0, 0,0,7, 256

BLACKSCREEN
DRAWSPRITE 0, 100, 100
SHOWSCREEN
MOUSEWAIT


Note : On the iPhone, this command only works in Portrait mode.

See also...