Graphics And Rendering - Study Mode
[#1] What is the purpose of the canvas element?
Correct Answer
(C) Creates drawing surface & Exposes powerful drawing API to client-side JavaScript
Explanation
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.
[#2] From which version of IE is canvas supported?
Correct Answer
(C) 9
Explanation
Solution: The canvas element is not supported by IE before IE9, but it can be reasonably well emulated in IE6, 7, and 8.
[#3] Which method is used to obtain the “drawing context” object ?
Correct Answer
(A) getContext()
Explanation
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.
[#4] What is the returning value of the getContext() method?
Correct Answer
(B) CanvasRenderingContext2D object
Explanation
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.
[#5] How does SVG describe complex shapes?
Correct Answer
(C) Path of lines and curves
Explanation
Solution: SVG describes complex shapes as a “path” of lines and curves that can be drawn or filled.