Home Contents | # gcx:resize | Graphics | Core4 Lua Commands

## SYNOPSIS

gcx:resize([width] [, height [, depth]])

## DESCRIPTION

Resizes the existing pixmap to width by height pixels and using depth bits per pixel. If any of the parameters is nil or absent, the original value is left unchanged.

When resizing a pixmap, all windows into this pixmap that where created using gcx:window() become invalid and can no longer be used.

Currently, only the hardware framebuffer can be resized. If the passed width or height values are smaller than the attached hardware, the resize operation fails. If the values are bigger, the operation succeeds, but the display hardware shows only the top-left box of the resized area that fits.

## RETURN VALUE

On success, returns true. On failure, returns three values: nil, a string describing the error (The result of the C library call strerror() on the errno code) and the errno number from the standard C library.

## ERRORS

Raises an error if gcx is not a graphics context.

## BUGS

Resizing works only for the hardware framebuffer.

TODO: Accessing pixmaps that became invalid after a resize operation crashes the lua interpreter, as the memory of the old framebuffer has been unmapped.

## SEE ALSO

gcx:origin, gcx:size, gcx:height, gcx:width