这给我带来了营养——我一直在圈子里,这是不受欢迎的。 我装上了多种动态图像,并有一个简单的 Java字标语,我对每个图像都进行了即时检查,一旦图像装满同步,就会有倒退。
I have verified that the callback code works just fine on a stand-alone basis (ie. I can call the callback manually after the image has loaded, and the image is rendered correctly), and I have verified that the image itself is successfully loaded (by switching the object s callback for a simple one line logging function), but when I try to tie it all together, the callback apparently never gets invoked.
我对联合材料说得较新,我怀疑,我缺少一些关于目标内职能定义的基本内容,但尽管有很多戈格罗宁,我还是可以做些什么。
请有人告诉我我我我我,我的方法有误?
function ImageHolder(aX,aY,aW,aH, anImageURL) {
this.posx=aX;
this.posy=aY;
this.posw=aW;
this.posh=aH;
this.url=anImageURL;
this.myImage = new Image();
this.myImage.onload=this.onload;
this.myImage.src=anImageURL;
this.onload=function() {
try {
var d=document.getElementById("d");
var mycanvas=d.getContext( 2d );
mycanvas.drawImage(this.myImage, this.posx, this.posy, this.posw, this.posh);
} catch(err) {
console.log( Onload: could not draw image +this.url);
console.log(err);
}
};
}