Identifying the Canvas element's methods and properties


show more Identifying the Canvas element's methods and properties provides you with in-depth training on Developer. Taught by Joe Marini as part of the HTML5: Graphics and Animation with Canvas show less
please wait ...

Identifying the Canvas element's methods and properties

We've seen how to declaratively create a canvas in HTML. In this example, let's see how we can use script to affect how canvas looks on the browser. So I'm going to open up my example file, and in my exercise files, and I'm in chapter 04, and we'll open up contextprops_start, and you can see we've got some code we need to write. Let's go and take a look at this in the browser really quick. So I'll bring this up in IE, and you can see there's a dotted outline. There is no background color here, just the outline, and what we're going to do is write some code that will affect how the canvas tag itself is displayed in the browser.

So let's go back to the code and over in my snippets, I'm going to copy the three lines under the ContextProps section, so we'll copy those and we'll put them in here, in the window.onload function. So what we're doing here is when the window loads, we've got some code that's going to get a referen...

Identifying the Canvas element's methods and properties
Video duration: 1m 40s 3h 7m Intermediate

Viewers:

Identifying the Canvas element's methods and properties provides you with in-depth training on Developer. Taught by Joe Marini as part of the HTML5: Graphics and Animation with Canvas

Subjects:
Developer Web
Software:
HTML
Author:
please wait ...