这个问题我回过几次了.
----------个性签名--------------
http://www.esoftnow.com/bbs

解决方案 »

  1.   

    把你上面的函数换成下面我这个:
    function  DrawImage(ImgD){  
         var  image=new  Image();  
         image.src=ImgD.src;  
         if(image.width>0  &&  image.height>0){  
           flag=true;  
           if(image.width/image.height>=  125/115){  
             if(image.width>125){      
             ImgD.width=125;  
             ImgD.height=(image.height*125)/image.width;  
             }else{  
             ImgD.width=image.width;      
             ImgD.height=image.height;  
             }  
             ImgD.alt=image.width+"×"+image.height;  
             }  
           else{  
             if(image.height>115){      
             ImgD.height=115;  
             ImgD.width=(image.width*115)/image.height;            
             }else{  
             ImgD.width=image.width;      
             ImgD.height=image.height;  
             }  
             ImgD.alt=image.width+"×"+image.height;  
             }  
           }  
    }