Ok algo sencillo quedaria asim pero si tienes que estudiar un poco mas, cuando declaras una variable como "cxt" esta es de ambito global no tienes que llamarla con "this" , y sobre prototypes hay si que tienes que practicar.
Código Javascript
:
Ver originalwindow.addEventListener('load',run,false);
var lienzo, contexto;
lienzo = document.getElementById("caja");
contexto = lienzo.getContext('2d');
function cargaImagen (dondeEstoy)
{
this.imagen = new Image();
this.imagen.src = dondeEstoy;
};
cargaImagen.prototype.subeImagen = function (contexto)
{
contexto.drawImage(this.imagen,100,0);
};
var gato = new cargaImagen("cualquiera.png");
function run(){
gato.subeImagen(contexto);
}