Canvas drawImage example 2

function canvasReady() {
  draw(document.getElementById('canvas').getContext('2d'));
}
function draw(ctx) {
  var img = new Image();
  img.onload = function(){
    var i, j;
    ctx.globalAlpha = 0.5;
    for (i=0;i<4;i++){
      for (j=0;j<3;j++){
        ctx.drawImage(img,j*50,i*38,50,38);
      }
    }

    // prevent IE6 memory leak
    img = null;
  }
  img.src = '../img/rhino.jpg';
}
      

Source image