ExamVeda
Login
Home
11
What is the purpose of the canvas element?
Discuss
Answer & Solution
Answer: Option C
Solution:
The canvas element has no appearance of its own but creates a drawing surface within the document and exposes a powerful drawing API to client-side JavaScript.
12
From which version of IE is canvas supported?
Discuss
Answer & Solution
Answer: Option C
Solution:
The canvas element is not supported by IE before IE9, but it can be reasonably well emulated in IE6, 7, and 8.
13
Which method is used to obtain the “drawing context” object ?
Discuss
Answer & Solution
Answer: Option A
Solution:
Most of the Canvas drawing API is defined not on the canvas element itself, but instead on a “drawing context” object obtained with the getContext() method of the canvas.
14
What is the returning value of the getContext() method?
Discuss
Answer & Solution
Answer: Option B
Solution:
Call getContext() with the argument “2d” to obtain a CanvasRenderingContext2D object that you can use to draw two-dimensional graphics into the canvas. It is important to understand that the canvas element and its context object are two very different objects.
15
How does SVG describe complex shapes?
Discuss
Answer & Solution
Answer: Option C
Solution:
SVG describes complex shapes as a “path” of lines and curves that can be drawn or filled.
16
Which is the method invoked to begin a path?
Discuss
Answer & Solution
Answer: Option D
Solution:
The beginPath() is used to begin a new path.
17
Which is the method invoked to connect the last vertex back to the first?
Discuss
Answer & Solution
Answer: Option A
Solution:
The closePath() method connects the last vertex back to the first, thereby creating a path.
18
Which of the following are not the properties of a canvas object?
Discuss
Answer & Solution
Answer: Option D
Solution:
There is no property called lineSize associated with the canvas object.
19
Which of the following is a property used to check how crisp or fuzzy shadows are?
Discuss
Answer & Solution
Answer: Option B
Solution:
shadowBlur is used to check how crisp or fuzzy shadows are.
20
How do you restore a saved coordinate system?
Discuss
Answer & Solution
Answer: Option A
Solution:
The saved coordinate system is restored by calling the method restore() associated with the canvas object.