<b>프로그램 코드는 다음과 같습니다. </b><br> <div class="code_main" id="CODE_7643" style="OVERFLOW-Y: auto; OVERFLOW-X: hidden; HEIGHT: 300px"><script 언어="JavaScript"><br><!--<BR>//이미지 크기가 비례적으로 조정됩니다.<BR>var flag=false;<BR>function DrawImage(ImgD,iwidth,iheight ) {<BR> //매개변수(이미지, 허용 너비, 허용 높이)<BR> var image=new Image();<BR> image.src=ImgD.src;<BR> if(image.width>0 && image.height>0){<br> flag=true;<br> if(image.width/image.height>= iwidth/iheight){<br> if(image.width>iwidth){ <br> ImgD . width=iwidth;<br> ImgD.height=(image.height*iwidth)/image.width;<br> }else{<br> ImgD.width=image.width; <br> ImgD.height=이미지 높이. ;<br> }<br> ImgD.alt=image.width "×" image.height;<br> }<br> else{<br> if(image.height>iheight){ <br> ImgD.height = iheight;<br> ImgD.width=(image.width*iheight)/image.height; <br> else{<br> ImgD.width=image.width; <br> ImgD.height=image .height; > }<br> ImgD.alt=image.width "×" image.height;<br> }<br> }<br>} <br>//--><br></script> >전화: <img src="images/tologo.gif" onload="javascript:DrawImage(this,100,100)"><br><br> </div>