logo
  • Home
  • Rank
  • Tests
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Contact

HTML Multiple Choice Questions | MCQs | Quiz

HTML Interview Questions and Answers
Practice HTML questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

•   Traditional HTML & XHTML
•   (X)HTML Rules
•   Web Browsers
•   Choosing Editors & IDEs
•   Choosing Web Servers
•   Compatibility Libraries
•   Metadata
•   Microdata
•   Favicons & Icons
•   (X)HTML Major Themes
•   HTML5 Introduction - 1
•   HTML5 Introduction - 2
•   HTTP Overview
•   Embracing Web Markup
•   HTML5 Document Structure
•   HTML5 Open Media Effort
•   HTML5 Video
•   HTML5 Audio
•   Canvas Clientside Graphics
•   HTML5 Form Changes
•   Web Applications Elements
•   HTML5: Beyond Markup
•   Major HTML5 Themes
•   Scalable Vector Graphics
•   Audio & its MIME Types
•   Forms Input Types
•   Web Storage
•   Forms & Minification
•   Web Communications
•   XHTML Element Reference
•   HTML5 Attributes Reference
•   HTML 4.x Entities
•   HTML Fonts
•   Document Type Definitions
•   Semantic Elements
•   Drag & Drop
•   Geolocation API
•   Cache Manifest File
•   Images Optimization
•   HTML Features - Modernizr
•   URL Encoding
•   Web Databases
•   Image Sprites
•   ↓ Web Performance ↓
•   Web Optimization - 1
•   Web Optimization - 2
•   Tables Working
•   JavaScript & jQuery - 1
•   JavaScript & jQuery - 2
•   JavaScript & jQuery - 3
•   Linking between Pages
•   Bullet & Definition Lists
•   Other Sites Linking
•   Adding Flash Videos
•   Styling HTML5 Layout
•   HTML5 Layout Elements
•   Search Engine Optimization
•   HTML Google Maps - 1
•   HTML Google Maps - 2
•   HTML Plugins - 1
•   HTML Plugins - 2
•   HTML5 Semantics - 1
•   HTML5 Semantics - 2
•   HTML5 Semantics - 3
•   HTML5 YouTube Videos
•   HTML Geolocation
•   Responsive Overview - 1
•   Responsive Overview - 2
•   Responsive Overview - 3
•   Responsive Overview - 4
•   Responsive Overview - 5
•   Responsive Overview - 6
•   Responsive Overview - 7
•   Responsive Overview - 8

Best Reference Books

•   HTML Books


« Prev Page
Next Page »

HTML Questions & Answers – Client-Side Graphics with Canvas

Posted on July 13, 2018 by Manish

This set of HTML test focuses on “Client-Side Graphics with Canvas”.

1. Which of the following element is used for canvas graphics?

advertisement
a) <paint>
b) <canvas>
c) <graphic>
d) <css>
View Answer
Answer: b
Explanation: CSS i.e. Cascading Style Sheet is a scripting language. Canvas graphics is introduced in HTML5. Element used for canvas graphics is <canvas>. The HTML canvas element is used to draw graphics, on the fly, via scripting (usually JavaScript).
 
 

2. Which of the following statement is not true?
a) SVG stands for Scalable Vector Graphics
b) SVG is used to define graphics for the Web
c) SVG is a W3C recommendation
d) SVG doesn’t support event handlers
View Answer

Answer: d
Explanation: SVG stands for “Scalable Vector Graphics”, it is used to draw graphics for the web. W3C recommends SVG graphics. SVG also supports event handlers which is not supported in canvas.

3. To draw on the canvas, authors must first obtain a reference to a context using the ______________ method of the canvas interface element.
a) getImageData
b) toDataURL
c) getContext
d) restore
View Answer

Answer: c
Explanation: The method getImageData(), returns an imageData that copies pixel data for a specified thing in canvas. ContextType is a DOMString containing the context identifier defining the drawing context associated to the canvas.

4. The ___________ method must add the scaling transformation described by the arguments to the transformation matrix.
a) scale(x, y)
b) translate(x, y)
c) rotate(angle)
d) skew(x,y)
View Answer

Answer: a
Explanation: HTML5 canvas provides scale(x, y) method which is used to increase or decrease the units in our canvas grid. The position (0, 0) is remaped in canvas by translate(x, y) method. If one want to rotate the current drawing then rotate(angle) method can be used.
advertisement

5. Which method must clear the pixels in the specified rectangle that also intersects the current clipping region to a fully transparent black, erasing any previous image?
a) strokeRect(x, y, w, h)
b) clearRect(x, y, w, h)
c) fillRect(x, y, w, h)
d) removeRect(x,y,w,h)
View Answer

Answer: b
Explanation: StrokeRect(x, y, w, h) draws rectangle without filling it. The clearRect() method clears the specified pixels within a given rectangle. FillRect(x, y, w, h) method draws filled rectangle.

6. When the _____________ method is passed an animated image as its image argument, the user agent must use the poster frame of the animation, or, if there is no poster frame, the first frame of the animation.
a) measureText()
b) imageData()
c) drawImage()
d) setImage()
View Answer

Answer: c
Explanation: The width of specified text present in an object is given by measureText() method. The drawImage() method draws an image, canvas, or video onto the canvas. ImageData() method provides image data in pixels in canvas.

7. The ____________ method must create a new clipping region by calculating the intersection of the current clipping region and the area described by the current path, using the non-zero winding number rule.
a) fill()
b) stroke()
c) clip()
d) get()
View Answer

Answer: c
Explanation: The path one defines is drawn by stroke() method. Any region/shape or size in canvas is clipped by clip(). The fill() method fills the current drawing (path). The default color is black. There is no method like get().

8. The ____________ method must fill all the subpaths of the current path, using fillStyle, and using the non-zero winding number rule.
a) fill()
b) stroke()
c) clip()
d) get()
View Answer

Answer: a
Explanation: The path one defines is drawn by stroke() method. Any region/shape or size in canvas is clipped by clip(). The fill() method fills the current drawing (path). The default color is black. There is no method like get().

9. Which of the following methods must empty the list of subpaths so that the context once again has zero subpaths?
a) closePath()
b) beginPath()
c) moveTo(x, y)
d) endPath()
View Answer

Answer: b
Explanation: ClosePath() creates a path that starts from current point up to the starting point. The beginPath() method begins a path, or resets the current path. MoveTo(x, y) moves the point specified in canvas but without creating the line. There is nothing like endPath() in canvas.
advertisement

10. An API is an application programming interface consisting of methods and properties which allow the author to get or set data or execute commands to the user agent.
a) True
b) False
View Answer

Answer: a
Explanation: API, an abbreviation of application program interface, is a set of routines, protocols, and tools for building software applications. API allow the author/owner to get or set data or execute commands to the user agent.

Sanfoundry Global Education & Learning Series – HTML.

To practice all areas of HTML for tests, here is complete set of 1000+ Multiple Choice Questions and Answers.

« Prev Page - HTML Questions & Answers – HTML5 Audio
» Next Page - HTML Questions & Answers – HTML5 Form Changes

« HTML Questions & Answers – HTML5 Audio
HTML Questions & Answers – HTML5 Form Changes »
advertisement

Deep Dive @ Sanfoundry:

  1. Javascript Questions and Answers
  2. Java Programming Examples on Collections
  3. Electrical & Electronics Engineering Questions and Answers
  4. Information Technology Questions and Answers
  5. Master of Computer Applications Questions and Answers
  6. Java Programming Examples on Event Handling
  7. Information Science Questions and Answers
  8. C# Programming Examples on Threads
  9. Computer Graphics Questions and Answers
  10. HTML Questions and Answers
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
Terms
Privacy Policy
Jobs
Bangalore Training
Online Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry. All Rights Reserved.