Вы находитесь на странице: 1из 8

INTRODUCTION

Computer graphic is an easy and attractive way of


displaying information with the help of circles,
lines etc .
The computer screen is made of tiny dots called
Pixels. These pixels are lighted up to a given
colour. The more the number of pixels, the
display of graphics will be clearer and better. So
we say that the resolution is higher. The number
of pixels can be adjusted by changing the display
settings and modes.
There are two types of modes in BASIC:
Text mode and Graphic mode
TEXT MODE : This is the normal mode in Basic
when you work with programs and data.
GRAPHIC MODE: This mode is used to draw
pictures and geometric figures.
SCREEN COMMAND
Before graphics can be drawn on the screen, a graphic
display mode must be activated. This is done with the
SCREEN Command given along with the mode
numbers. There are 10 mode numbers that define
different types of screen resolutions. The mode
numbers can be 0,1,2,7,8,9,10,11,12 and 13.
Example
SCREEN 0: This is the text mode screen. It doesn't support
graphics.
SCREEN 1: This is the graphics mode screen with the
resolution of 320 X 200 pixels.
The LINE COMMAND
Lines can be drawn using the LINE COMMAND.
Syntax:
Line(x1,y1) (x2,y2)
Where (x1,y1) and (x2,y2) are coordinate pairs which define
the start and end points of the lines respectively.
Example: Draw a line starting from( 400, 300) (800,600).
CLS
SCREEN 12
LINE (400,300) (800,600)
END
A line will be drawn on the screen as the result of the above
program

Вам также может понравиться