Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 114 - 2505_CoreGPT(Podar)_Flipbook_C7
P. 114

    Graphics in BASIC-256
                              9

                           Goal Glimpse

                               Graphics Window                                 Colours in Graphics
                               Statements in BASIC-256

                      Graphics in BASIC-256 introduces the use of a graphics window for creating visual elements
                      like dots, lines and shapes. Students will learn commands such as PLOT, LINE, RECTANGLE and
                      CIRCLE to design graphics and apply colours. The chapter also covers creating complex shapes
                      like polygons and ellipses for interactive programs.

                            GRAPHICS WINDOW

                      In BASIC-256, you can work with a graphics window in addition to the text-based output. This
                      allows you to draw shapes like lines, circles and even create animations. The graphics window
                      appears  alongside  the  text  window,  making it  easy  to  visually display the  output  of  your
                      program. It is made up of tiny dots called pixels. It’s a useful tool for projects that need graphical

                      representation or interactive visuals.
                      Opening the Graphics Window

                      The graphics window automatically opens when you use any graphics statement. To open and
                      work with the graphics window, you can use the following syntax:

                      Graphics Width, Height
                          ✶  WIDTH: The width of the graphics window (in pixels).

                          ✶  HEIGHT: The height of the graphics window (in pixels).

                      These are commands used in BASIC-256 programming for controlling graphics on the screen:
                      1.  CLS (Clear Screen) and CLG (Clear graphic)

                      The CLS command clears the text output window only.

                    112     Premium Edition-VII

| 109 110 111 112 113 114 115 116 117 118 119 |