Presentation is loading. Please wait.

Presentation is loading. Please wait.

GRAPHICS IN QBASIC Sunday, September 25, Using Graphics In QB64, it is very easy and interesting to create and display graphics on screen. We use.

Similar presentations


Presentation on theme: "GRAPHICS IN QBASIC Sunday, September 25, Using Graphics In QB64, it is very easy and interesting to create and display graphics on screen. We use."— Presentation transcript:

1 GRAPHICS IN QBASIC Sunday, September 25, 2022

2 Using Graphics In QB64, it is very easy and interesting to create and display graphics on screen. We use pixels to draw lines, figures and patterns of different shapes. There are two common mode of display:  Text Mode: Used to write programs and to get their specific output.  Graphic Mode: Used to draw figures on the screen. This is achieved by using commands, Screen 1, Screen 2, Screen 7 etc. The number along with the Screen statement defines the pixels of the screen. Sunday, September 25, 2022

3 Colour Chart LO: To know the types of screen and color code in QB64 Sunday, September 25, 2022

4 COLOR Statement To select any specified color you need to mention the correct colour number. This statement is used to set attractive screen colours to display text and the graphics. Syntax: COLOR parameter f COLOR parameter f, parameter b f specifies foreground color b specifies background color There are 16 colour options for background and foreground colours, specifically 0 to 15. COLOR 3,12 Sunday, September 25, 2022

5 Line Statement The line command allows you to draw lines to make lines or transparent shapes like rectangles or triangles using the lines to make up their perimeter. Syntax: LINE (X1,Y1)-(X2,Y2),COLOR Program to draw a triangle Cls Screen 12 Line (30, 30)-(30, 90), 14 Line (30, 90)-(90, 60), 3 Line (90, 60)-(30, 30), 6 Line (160, 30)-(250, 180), 7 Line (250, 180)-(70, 180), 2 Line (70, 180)-(160, 30), 11 End LO: To understand the line statement and draw 2D shapes Program to draw a square Cls Screen 12 Line (100, 100)-(400, 100), 14 Line (100, 400)-(400, 400), 14 Line (100, 100)-(100, 400), 14 Line (400, 100)-(400, 400), 14 Sunday, September 25, 2022

6 (400, 100)(100, 100) (100, 400)(400, 400) Square (100, 100) (100, 300) Rectangle (500, 100) (500, 300) line 1 line 2 line 3 line 4 line 1 line 2 line 3 line 4 LO: To understand the line statement and draw 2D shapes Sunday, September 25, 2022 Grade 7

7 Circle Statement The Circle statement is used to draw a circle, ellipse or an arc of a circle Syntax: Circle (x,y),r,p  x & y - the center location of circle on the screen  r – value of radius  p - colour code Program to draw a circle Cls Screen 7 Color 14, 5 Print "This are two circles" Circle (160, 100), 50, 11 Circle (160, 100), 30, 14 End LO: To understand the Circle statement t0 draw a circle, ellipse Sunday, September 25, 2022

8 DRAW Command DRAW Command draws a straight line in any direction on the screen. The line is drawn with the help of a pointer in the middle of the screen. The line can be drawn in any direction using the particular characters. Sunday, September 25, 2022


Download ppt "GRAPHICS IN QBASIC Sunday, September 25, Using Graphics In QB64, it is very easy and interesting to create and display graphics on screen. We use."

Similar presentations


Ads by Google