/******°´±ÈÀýËõ·ÅÍ¼Æ¬******/
function DrawImage(ImgD,imgwidth,imgheight){
var flag=false;
 var image=new Image();
 image.src=ImgD.src;
 if(image.width>0 && image.height>0){
  flag=true;
  if(image.width/image.height>= imgwidth/imgheight){
   if(image.width>imgwidth){
    ImgD.width=imgwidth;
    ImgD.height=(image.height*imgwidth)/image.width;
   }else{
    ImgD.width=image.width;
    ImgD.height=image.height;
   }
  }
  else{
   if(image.height>imgheight){
    ImgD.height=imgheight;
    ImgD.width=(image.width*imgheight)/image.height;
   }else{
    ImgD.width=image.width;
    ImgD.height=image.height;
   }
  }
 }
}