﻿function DrawImage(ImgD,int_width,int_height){
	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>= int_width/int_height){
			if(image.width>int_width){ 
				ImgD.width=int_width;
				ImgD.height=(image.height*int_width)/image.width;
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
		else{
			if(image.height>int_height){ 
				ImgD.height=int_height;
				ImgD.width=(image.width*int_height)/image.height; 
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
	}
} 
