Canvas test

by Dennis Betman

HTML

<canvas id="c" width="500" height="500"></canvas>

CSS

*{
    margin:0px;
    padding:0px;
}

canvas{
    border:1px solid black;
}

JavaScript

var c 	= document.getElementById('c');
var ctx	= c.getContext('2d');

// Draw a rect
ctx.fillStyle 	= "#FF0000";
ctx.fillRect(0,0,150,75);

//Draw a line
ctx.moveTo(20,20);
ctx.lineTo(480,480);
ctx.stroke();