Jump to content

MATLAB Programming/Psychtoolbox/Screen Commands/OpenWindow

From Wikibooks, open books for an open world

Usage:

[windowPtr,rect]=Screen(windowPtrOrScreenNumber,'OpenWindow',[color],[rect],[pixelSize]);

Open an onscreen window. Specify a screen by a windowPtr or a screenNumber (0 is the main screen, with menu bar). color is the clut index (scalar or [r g b] triplet) that you want to poke into each pixel; default is white. If supplied, rect must contain at least one pixel. If a windowPtr is supplied then rect is in the window's coordinates (origin at upper left), and defaults to the whole window. If a screenNumber is supplied then rect is in screen coordinates (origin at upper left), and defaults to the whole screen. (In all cases, subsequent references to this new window will use its coordinates: origin at its upper left.) pixelSize sets the depth (in bits) of each pixel; default is to leave depth unchanged. Opening or closing a window takes about a second.