﻿// JScript 文件

// JScript 文件
var flag=false; 
function DrawImage(ImgD,width){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= width/1024){ 
if(image.width>width){ 
ImgD.width=width; 
ImgD.height=(image.height*width)/image.width; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"x"+image.height; 
} 
else{ 
if(image.height>1024){ 
ImgD.height=1024; 
ImgD.width=(image.width*1024)/image.height; 
}else{ 
ImgD.width=image.width; 
ImgD.height=image.height; 
} 
ImgD.alt=image.width+"x"+image.height; 
} 
} 
} 

