Canvas image drawing test

by Jayson Buquia

HTML

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

CSS

#c {
    border: 1px solid gray;
}

JavaScript

var c = document.getElementById('c'),
	ctx = c.getContext('2d'),
    imgSrc = 'http://wallpapercave.com/wp/z8Zfa3Y.jpg',
    img = document.createElement('img').src(imgSrc);
    
console.log(ctx);

ctx.drawImage(
	img,
    0,0,
    300,null
)