18.11.2017 Views

html5_tutorial

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

HTML5<br />

<br />

<br />

#test {<br />

width: 100px;<br />

height:100px;<br />

margin: 0px auto;<br />

}<br />

<br />

<br />

function drawShape(){<br />

// get the canvas element using the DOM<br />

var canvas = document.getElementById('mycanvas');<br />

// Make sure we don't execute when canvas isn't supported<br />

if (canvas.getContext){<br />

// use getContext to use the canvas for drawing<br />

var ctx = canvas.getContext('2d');<br />

// Create a pattern<br />

for (var i=0;i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!