QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The VIEW statement creates a graphics view port area by defining the coordinate limits to be viewed.

Syntax

VIEW [SCREEN] (column1, row1)-(column2, row2)[, color], border]

Example(s)

Using SCREEN option with absolute screen coordinates.


 SCREEN 12
 VIEW SCREEN (200, 200)-(400, 400), 1, 9 ' blue BG with light blue border
 CIRCLE (220, 220), 20, 11 ' using the actual screen coordinates

Using coordinates relative to the viewport box area.


 SCREEN 12
 VIEW (200, 200)-(400, 400), 1, 9 
 CIRCLE (20, 20), 20, 11 ' using coordinates inside of the viewport

Explanation: The relative coordinates are automatically adjusted to place the object correctly. Any values outside of the box’s area will not be displayed. Both examples should display the same screen image.

See Also