//============================================================================ //ͼƭ��с�ȱ������� var flag=false; function drawimage(imgd,imwidth,imheight){ var image=new image(); image.src=imgd.src; if(image.width>0&&image.height>0){ flag=true; if(image.width/image.height>=imwidth/imheight){ if(image.width>imwidth){ imgd.width=imwidth; imgd.height=(image.height*imwidth)/image.width; }else { imgd.width=image.width; imgd.height=image.height; } //imgd.alt=image.width+"x"+image.height; } else { if(image.height>imheight){ imgd.height=imheight; imgd.width=(image.width*imheight)/image.height; }else{ imgd.width=image.width; imgd.height=image.height; } //imgd.alt=image.width+"x"+image.height; } } }