$(document).ready(function() {
	var canvas = document.getElementById('render');
	var ctx = canvas.getContext('2d');

	addImage('images/ios-background.png');

	function addImage(url) {
		var img = new Image();
		img.src = url;

		img.onload = function() {
			ctx.drawImage(img, 0, 0, img.width / 2, img.height / 2);
		}
		console.log(img);
	}
});
@@ -173,16 +173,38 @@
 mage(url
+, x, y, scaleX, scaleY
 ) %7B%0A%09%09va
@@ -296,67 +296,608 @@
 mg, 
-0, 0, img.width / 2, img.height / 2);%0A%09%09%7D%0A%09%09console.log(img
+x %7C%7C 0, y %7C%7C 0, img.width * (scaleX %7C%7C 0.5), img.height * (scaleY %7C%7C 0.5));%0A%09%09%7D%0A%09%7D%0A%0A%09function roundedImage(x, y, width, height, radius) %7B%0A%09%09ctx.beginPath();%0A%09%09ctx.moveTo(x + radius, y);%0A%09%09ctx.lineTo(x + width - radius, y);%0A%09%09ctx.quadraticCurveTo(x + width, y, x + width, y + radius);%0A%09%09ctx.lineTo(x + width, y + height - radius);%0A%09%09ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);%0A%09%09ctx.lineTo(x + radius, y + height);%0A%09%09ctx.quadraticCurveTo(x, y + height, x, y + height - radius);%0A%09%09ctx.lineTo(x, y + radius);%0A%09%09ctx.quadraticCurveTo(x, y, x + radius, y);%0A%09%09ctx.closePath(
 );%0A%09

add roundedImage() and tweak addImage() to accept x, y, scaleX, scaleY params