<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script language="JavaScript" type="text/javascript">
function DrawImage(ImgD,FitWidth,FitHeight)
{
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0)
{
if(image.width/image.height>= FitWidth/FitHeight)
{
if(image.width>FitWidth)
{
ImgD.width=FitWidth;
ImgD.height=(image.height*FitWidth)/image.width;
}
else
{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
else
{
if(image.height>FitHeight)
{
ImgD.height=FitHeight;
ImgD.width=(image.width*FitHeight)/image.height;
}
else
{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width='96' height='106' border='0' cellpadding='0' cellspacing='0' style='border: 1px solid #666666; display:block; width:96; height:106px;'>
<tr>
<td width='96' height='106' align='center'>
<img src="20110427084247.jpg" alt="自动缩放后的效果" onload="javascript:DrawImage(this,'96','106')" /></td>
</tr>
</table>
</div>
</form>
</body>
</html>

被折叠的 条评论
为什么被折叠?



