No sé porque no me aparece la imagen , he revisado bien el codigo y no veo ningun problema o no sé, ojala me puedan ayudar:
Código Javascript
:
Ver originalvar lienzo, cxt;
lienzo = document.getElementById("c");
cxt = lienzo.getContext("2d");
var cargaImagen = function(dondeEstoy)
{
this.imagen = new Image();
this.imagen.src = dondeEstoy;
this.imagen.onload = subeImagen;
}
cargaImagen.prototype.subeImagen = function ()
{
this.cxt.drawImage(this.imagen,0,0);
}
var gato = new cargaImagen("imagen.jpg");
No me sale la imagen y me sale en la consola
Código:
Uncaught ReferenceError: subeImagen is not defined
He probado al dibujar (drawImage) quitando el this o el cxt , pero no me sale la imagen aun , también he probado con variables globales y nada ... no entiendo porque me pasa esto.