function DrawImageSize(ImgD,Width,Height){ 
var image=new Image(); 
image.src=document.getElementById(ImgD).src; 
flag=true; 
image.src.resized=true;
if (image.width/image.height>Width/Height){//ÒÔ¿íÎª×¼
if (image.width>Width){
document.getElementById(ImgD).width=Width
document.getElementById(ImgD).height=Width*image.height/image.width
}
else{
//document.getElementById(ImgD).width=Width
//document.getElementById(ImgD).height=Width*image.height/image.width
}
}
else{
if (image.height>Height){
document.getElementById(ImgD).height=Height
document.getElementById(ImgD).width=Height*image.width/image.height
}
else{
//document.getElementById(ImgD).height=Height
//document.getElementById(ImgD).width=Height*image.width/image.height
}
} 
}