# vs.eyeandcontacts.com

## Chapter 10 Graphics in QB64

Brain Developers
A. Fill in the blanks:
1. In high resolution, the computer screen is divided into _________ pixels.
2. The amount of pixels per unit on the screen is called the _____________.
3. The ____________ statement is used to draw a straight line.
4. Screen 7 supports _________ different colours.
5. The “H” statement draws a line diagonally in upward direction towards the ______ side.
Answer:

1. In high resolution, the computer screen is divided into 640 × 200 pixels.
2. The amount of pixels per unit on the screen is called the resolution.
3. The Line statement is used to draw a straight line.
4. Screen 7 supports 16 different colours.
5. The “H” statement draws a line diagonally in upward direction towards the left side.

B. State True or False:
1. The Screen 0 mode is used only for text. (True)
2. In medium resolution mode, the computer screen is divided into 320 × 400 pixels. (False)
Correct Answer: In medium resolution mode, the computer screen is divided into 320 (horizontal) × 200 (vertical) pixels.
3. The LINE statement is used to fill an object with a colour. (False)
Correct Answer: The PAINT statement is used to fill an object with a colour.
4. To draw vertical lines, y-axis co-ordinates will remain same for both starting and ending points. (False)
Correct Answer: To draw vertical lines, x-axis co-ordinates will remain same for both starting and ending points.
5. The background colour code for Gray colour is 7. (True)

C. Application Based Questions:
1. Kabir wants to draw a box filled with colour using the Line statement, but he is unable to recollect the keyword for making a filled box. Help him to finish this task.
Answer:
He can use BF to draw a box filled with colour using Line statement.

2. The computer teacher has asked Swati to draw vertical lines. Which co-ordinates will you suggest her to set for both starting and ending points of the line?
Answer:
She can use x-axis to draw vertical lines.

D. Multiple Choice Questions:
1. There are _____ colour options for background and foreground colours.
a) 20
b) 16
c) 15
Answer:
b) 16

2. We use ______ statement to draw lines, figures and patterns of different shapes from any point of the screen.
a) PSET
b) SCREEN
c) LINE
Answer:
a) PSET

3. To draw a fill box, the letter __________ is used with line co-ordinates.
a) B
b) BF
c) BC
Answer:
b) BF

4. ____________ statement is used to set the screen resolution.
a) Drawing Boxes
b) Color
c) Screen
Answer:
c) Screen

5. We cannot create any graphics in __________ mode.
a) Screen 5
b) Screen 2
c) Screen 0
Answer:
c) Screen 0

E. Find the output of following programs:

Answer:

F. Answer the following:
1. What is the use of PSET command?
Answer:
The PSET command stands for Point Set. This command is used to set the pixels at any specific location on the screen. It allows you to draw figures by changing the value of (x, y) co-ordinates. Its syntax is: PSET (x,y)

2. Explain in brief the use of CIRCLE statement.
Answer:
The Circle statement is used to draw a circle, ellipse or an arc of a circle. We need to specify the centre location through (x,y) co-ordinates, radius of the circle (r), and colour code (p). Its syntax is: CIRCLE (x, y), r, p

3. What is the difference between B and BF options used with Line statement?
Answer:
B option used with Line statement is used to draw outline of the box, whereas, BF statement allows us to draw a box filled with desired colour.

4. Explain the function of_NEWIMAGE command available in QB64.
Answer:
_NEWIMAGE screen statement is used to create a new screen size with higher resolution using the predefined screen options.

5. What is the use of PAINT statement?
Answer:
The PAINT statement is used to fill an object with a colour. It specifies the co-ordinates from where the figure starts and fills the colour within the enclosed area.

6. How can we draw a rectangle? Explain with an example.
Answer:

We can draw a rectangle in QB64 by using the LINE statement. The following commands create a rectangle:
SCREEN 7
COLOR 5,15
CLS
PRINT "This is a Rectangle"
LINE(60,60)-(130,100),6,BF

#### 4 comments:

1. I found this chapter difficult but when u posted it... It became easy for me solve! Tq @vs... Pls post link for Ch 8 and Ch 9 too...

2. Hi can u change ur name i am finding difficult in finding ur website just keep on posting we support u ❤

1. Hi user,
Thanks for your feedback. But it is not possible for us to change our website's name. Since we are a subdomain website, we've to rely on the name of our domain. As our domain name is "www.eyeandcontacts.com" so we can't simply replace it.