QBasic 1.1: WINDOW Statement
Explanation
WINDOW Statement
Defines logical dimensions for the current graphics viewport. Use the WINDOW statement to define your own viewport coordinate system.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
WINDOW [[SCREEN] (x1!,y1!)-(x2!,y2!)] |
Description / Parameter(s)
SCREEN |
Inverts the normal Cartesian direction of the y screen coordinates so that y values increase from the top of the screen to the bottom. |
(x1!,y1!) |
Logical coordinates that map to the upper-left screen coordinates of the viewport. |
(x2!,y2!) |
Logical coordinates that map to the lower-right screen coordinates of the viewport. |
WINDOW with no arguments disables the logical coordinate system. |
Use the VIEW statement to change the size of the viewport. |
Example
'This example requires a color graphics adapter.
SCREEN 1
FOR i% = 1 TO 10 STEP 2
WINDOW (-160 / i%, -100 / i%)-(160 / i%, 100 / i%)
CIRCLE (0, 0), 10
NEXT i%