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

## SYNOPSIS

1. w, h = gcx:size()
2. w = gcx:width()
3. h = gcx:height()
4. bpp = gcx:bpp()

## DESCRIPTION

Allows to query the size (in pixels) and bit depth of the specified graphics context gcx.

## RETURN VALUE

The function gcx:size() returns two numbers, the width and height of the graphics context. The functions gcx:width() and gcx:height() return the width and height of the buffer as a single value each. The function gcx:bpp() returns the number of bits used per pixel.

The width and height represent the logical display size, after applying the orientation setting. Specifically, at orientations 90° or 270°, the width and height are swapped with regard to the physical display orientation.

## ERRORS

Raises an error if gcx is not a graphics context.

## EXAMPLE

> >
fb = gfx.open() print (fb:width(), fb:height(), fb:size(), fb:bpp())
480 272 480 272 24

## SEE ALSO

gfx.size, gfx.height, gfx.width, gcx:resize