Computer graphics can display information visually using geometric shapes and pixels on a screen. There are two display modes: text mode for programs and data, and graphic mode for drawing pictures. The SCREEN command activates a graphic display mode based on the resolution defined by a mode number from 0 to 13. The LINE command then draws lines between coordinate point pairs, allowing the creation of graphics. For example, a line can be drawn from point (400,300) to (800,600) using SCREEN 12 for the resolution.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
85 views8 pages
Qbasic
Computer graphics can display information visually using geometric shapes and pixels on a screen. There are two display modes: text mode for programs and data, and graphic mode for drawing pictures. The SCREEN command activates a graphic display mode based on the resolution defined by a mode number from 0 to 13. The LINE command then draws lines between coordinate point pairs, allowing the creation of graphics. For example, a line can be drawn from point (400,300) to (800,600) using SCREEN 12 for the resolution.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 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