Skip to Main Content
Pro HTML5 with Visual Studio 2015
book

Pro HTML5 with Visual Studio 2015

by Mark J. Collins
June 2015
Intermediate to advanced content levelIntermediate to advanced
452 pages
9h 59m
English
Apress
Content preview from Pro HTML5 with Visual Studio 2015

CHAPTER 10

image

Canvas

In this chapter I’ll show how to use the canvas element in HTML5 to create some fun graphics. As you’ll see, it is very different from SVG, which you explored in the previous chapter. I will discuss the differences in more detail later, but the main thing you’ll notice is that canvas is completely implemented in JavaScript. The only part that is in the markup is a simple element definition like this:

<canvas id="myCanvas" width="400" height="400">    Canvas is not supported on this browser</canvas>

Instead, you’ll define the content by calling the various drawing methods using JavaScript. Just like with the audio and video

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Introducing HTML5, Second Edition

Introducing HTML5, Second Edition

Bruce Lawson, Remy Sharp
Node.js: Related Tools & Skills

Node.js: Related Tools & Skills

Craig Buckler, Jani Hartikainen, M. David Green, Olayinka Omole, Ahmed Bouchefra, Mark Brown, Paul Sauve, Manjunath M
Mastering Bootstrap 4 - Second Edition

Mastering Bootstrap 4 - Second Edition

Benjamin Jakobus, Jason Marah

Publisher Resources

ISBN: 9781484211472Purchase book