这几天在改别人的一个项目, 就是打印的, 打印可以打印,就是打印出来的图片太大,现在需要加个预览的功能,但是这页面又是有几个页面组起来的,我一直做C# js太烂了`,求告诉,下面贴出代码.<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>温州房产档案查询系统</title>
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body bgcolor="#7f9fd9">
<form id="frmDocViewTop" runat="server">
<table class="txt5" border="0" cellpadding="1" cellspacing="2" width="600">
<tr>
<td>
<asp:Label ID="labDocName" runat="server" Text="名称" Font-Size="12" Font-Bold="True" Font-Overline="False" ForeColor="yellow"></asp:Label></td>
</tr>
<tr>
<td>
<a href="javascript:zoom_img_in()" class="lnk6w">放大</a> |
<a href="javascript:zoom_img_out()" class="lnk6w">缩小</a> |
<a href="javascript:zoom_img_org()" class="lnk6w">原始</a> |
<a href="javascript:zoom_img_fit()" class="lnk6w">合适</a> |
<a href="javascript:print_img()" id="btPrint" class="lnk6w" runat="server">打印</a>
</td>
</tr>
<tr>
<td>
鼠标左键从上往下拉框可以放大,左键从下往上拉框可以缩小,鼠标右键拖放可以平移</td>
</tr>
<tr>
<td>
如果您无法正确看到图片,请点击<a href="http://150.1.1.223/wzfccg/DOTNETFX.EXE">这里</a>安装Microsoft .NET Framework 2.0</td>
</tr>
</table>
</form>
</body>
<script language="javascript">
function zoom_img_out()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.zoom_img_out();
}
}function zoom_img_in()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.zoom_img_in();
}
}function zoom_img_org()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.zoom_img_org();
}
}function zoom_img_fit()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.zoom_img_fit();
}
}function print_img()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.print_img();
}
}</script>
</html>
这两个是用来写功能的好像
````````
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>温州房产档案查询系统</title>
<link href="main.css" rel="stylesheet" type="text/css" />
</head><body leftmargin="0" topmargin="0">
<input id="imgDoc" type="image" runat="server" style="cursor:move; position:absolute"
onmousemove="on_mousemove()" onmousedown="on_mousedown()" onmouseup="" ondragover="on_dragover"/>
</body>
<script language="javascript">
<!--var m_nOrgWidth = 0;
var m_nOrgHeight = 0;var m_nStartPosX = 0;
var m_nStartPosY = 0;var m_nImgPosX = 0;
var m_nImgPosY = 0;var m_nPosX = 0;
var m_nPosY = 0;function on_mousedown()
{
var img = document.getElementById("imgDoc");
if ( img == null ) return;
m_nStartPosX = event.clientX;
m_nStartPosY = event.clientY;
m_nPosX = m_nStartPosX;
m_nPosY = m_nStartPosY;
}function on_mousemove()
{
var img = document.getElementById("imgDoc");
if ( img == null ) return;
var xPos = event.clientX;
var yPos = event.clientY;
if ( event.button == 1 )
{
m_nImgPosX += xPos - m_nPosX;
m_nImgPosY += yPos - m_nPosY;
img.style.left = m_nImgPosX;
img.style.top = m_nImgPosY;
}
m_nPosX = xPos;
m_nPosY = yPos;
}function zoom_img(w, h)
{
get_size(); var img = document.getElementById("imgDoc");
if ( img == null ) return;
img.width = w;
img.height = h;
}function zoom_img_scale(scale)
{
get_size();
var img = document.getElementById("imgDoc");
if ( img == null ) return;
var w = img.width * scale;
var h = img.height * scale;
img.width = w;
img.height = h;
}function zoom_img_rect(cx, cy)
{
var img = document.getElementById("imgDoc");
if ( img == null ) return;
var w = img.width;
var h = img.height;
var tv = cx / cy;
var ti = w / h;
var scale = 1.0;
if ( tv > ti )
{
scale = cy / h;
}
else
{
scale = cx / w;
}
zoom_img_scale(scale);
}function zoom_img_out()
{
zoom_img_scale(0.7);
}function zoom_img_in()
{
zoom_img_scale(1.4);
}function zoom_img_org()
{
get_size(); var img = document.getElementById("imgDoc");
if ( img == null ) return; m_nImgPosX = 0;
m_nImgPosY = 0;
img.style.left = m_nImgPosX;
img.style.top = m_nImgPosY; zoom_img_rect(m_nOrgWidth, m_nOrgHeight);
}function zoom_img_fit()
{
get_size();
var img = document.getElementById("imgDoc");
if ( img == null ) return;
m_nImgPosX = 0;
m_nImgPosY = 0;
img.style.left = m_nImgPosX;
img.style.top = m_nImgPosY;
zoom_img_rect( 600, 650 );
}var m_bIsGetSize = 0;function get_size()
{
if ( m_bIsGetSize != 0 ) return;
var img = document.getElementById("imgDoc");
if ( img == null ) return;
m_nOrgWidth = img.width;
m_nOrgHeight = img.height;
m_bIsGetSize = 1;
}function load_img(casenum, uid, picid)
{
imgDoc.src = "docviewimg.aspx?casenum=" + casenum + "&uid=" + uid + "&picid=" + picid
}//-->
</script>
</html>怎么这两页面都有这功能 我就搞不懂了``` 求高手``<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>温州房产档案查询系统</title>
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body id="imgBody">
<script language="javascript">var cx = window.screen.availWidth;
var cy = window.screen.availHeight;//alert( cx + "," + cy );window.parent.window.moveTo(0, 0);
window.parent.window.resizeTo( cx, cy );var w = cx - 350;
var h = cy - 300;
//var sTxt = "<object id='axWCWebImage' classid='clsid:f677b009-1260-4abf-9d11-aae4a6d6413d'";
var sTxt = "<object id='axWCWebImage' classid='http:WCWebImage.dll#WCWebImage.UCWebImageX'";
sTxt += " width=" + w + " height=" + h + "></object>"
document.writeln( sTxt );
</script>
</body>
<script language="javascript">
<!--function load_img(picid)
{
var svrPath = "<% =m_sSvrPath %>";
//axWCWebImage.LoadImage(svrPath + "docviewimg.aspx?casenum=" + casenum + "&uid=" + uid + "&picid=" + picid);
axWCWebImage.LoadImage(svrPath + "docviewimg.aspx?picid=" + picid);
//axWCWebImage.LoadImage(picid);
//alert(svrPath + "docviewimg.aspx?picid=" + picid);
axWCWebImage.ZoomAll();
}function zoom_img_fit()
{ axWCWebImage.ZoomAll();
}function zoom_img_out()
{
axWCWebImage.ZoomScale(1.4);
}function zoom_img_in()
{
axWCWebImage.ZoomScale(0.7);
}function zoom_img_org()
{
axWCWebImage.ZoomToScale(1.0);
}function print_img()
{
axWCWebImage.ImagePrint();
}-->
</script>
</html>该怎么加这预览功能? 求高手```
<head runat="server">
<title>温州房产档案查询系统</title>
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body bgcolor="#7f9fd9">
<form id="frmDocViewTop" runat="server">
<table class="txt5" border="0" cellpadding="1" cellspacing="2" width="600">
<tr>
<td>
<asp:Label ID="labDocName" runat="server" Text="名称" Font-Size="12" Font-Bold="True" Font-Overline="False" ForeColor="yellow"></asp:Label></td>
</tr>
<tr>
<td>
<a href="javascript:zoom_img_in()" class="lnk6w">放大</a> |
<a href="javascript:zoom_img_out()" class="lnk6w">缩小</a> |
<a href="javascript:zoom_img_org()" class="lnk6w">原始</a> |
<a href="javascript:zoom_img_fit()" class="lnk6w">合适</a> |
<a href="javascript:print_img()" id="btPrint" class="lnk6w" runat="server">打印</a>
</td>
</tr>
<tr>
<td>
鼠标左键从上往下拉框可以放大,左键从下往上拉框可以缩小,鼠标右键拖放可以平移</td>
</tr>
<tr>
<td>
如果您无法正确看到图片,请点击<a href="http://150.1.1.223/wzfccg/DOTNETFX.EXE">这里</a>安装Microsoft .NET Framework 2.0</td>
</tr>
</table>
</form>
</body>
<script language="javascript">
function zoom_img_out()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.zoom_img_out();
}
}function zoom_img_in()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.zoom_img_in();
}
}function zoom_img_org()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.zoom_img_org();
}
}function zoom_img_fit()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.zoom_img_fit();
}
}function print_img()
{
var frmright = window.parent.frames["frmRight"];
if ( frmright != null )
{
frmright.print_img();
}
}</script>
</html>
这两个是用来写功能的好像
````````
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>温州房产档案查询系统</title>
<link href="main.css" rel="stylesheet" type="text/css" />
</head><body leftmargin="0" topmargin="0">
<input id="imgDoc" type="image" runat="server" style="cursor:move; position:absolute"
onmousemove="on_mousemove()" onmousedown="on_mousedown()" onmouseup="" ondragover="on_dragover"/>
</body>
<script language="javascript">
<!--var m_nOrgWidth = 0;
var m_nOrgHeight = 0;var m_nStartPosX = 0;
var m_nStartPosY = 0;var m_nImgPosX = 0;
var m_nImgPosY = 0;var m_nPosX = 0;
var m_nPosY = 0;function on_mousedown()
{
var img = document.getElementById("imgDoc");
if ( img == null ) return;
m_nStartPosX = event.clientX;
m_nStartPosY = event.clientY;
m_nPosX = m_nStartPosX;
m_nPosY = m_nStartPosY;
}function on_mousemove()
{
var img = document.getElementById("imgDoc");
if ( img == null ) return;
var xPos = event.clientX;
var yPos = event.clientY;
if ( event.button == 1 )
{
m_nImgPosX += xPos - m_nPosX;
m_nImgPosY += yPos - m_nPosY;
img.style.left = m_nImgPosX;
img.style.top = m_nImgPosY;
}
m_nPosX = xPos;
m_nPosY = yPos;
}function zoom_img(w, h)
{
get_size(); var img = document.getElementById("imgDoc");
if ( img == null ) return;
img.width = w;
img.height = h;
}function zoom_img_scale(scale)
{
get_size();
var img = document.getElementById("imgDoc");
if ( img == null ) return;
var w = img.width * scale;
var h = img.height * scale;
img.width = w;
img.height = h;
}function zoom_img_rect(cx, cy)
{
var img = document.getElementById("imgDoc");
if ( img == null ) return;
var w = img.width;
var h = img.height;
var tv = cx / cy;
var ti = w / h;
var scale = 1.0;
if ( tv > ti )
{
scale = cy / h;
}
else
{
scale = cx / w;
}
zoom_img_scale(scale);
}function zoom_img_out()
{
zoom_img_scale(0.7);
}function zoom_img_in()
{
zoom_img_scale(1.4);
}function zoom_img_org()
{
get_size(); var img = document.getElementById("imgDoc");
if ( img == null ) return; m_nImgPosX = 0;
m_nImgPosY = 0;
img.style.left = m_nImgPosX;
img.style.top = m_nImgPosY; zoom_img_rect(m_nOrgWidth, m_nOrgHeight);
}function zoom_img_fit()
{
get_size();
var img = document.getElementById("imgDoc");
if ( img == null ) return;
m_nImgPosX = 0;
m_nImgPosY = 0;
img.style.left = m_nImgPosX;
img.style.top = m_nImgPosY;
zoom_img_rect( 600, 650 );
}var m_bIsGetSize = 0;function get_size()
{
if ( m_bIsGetSize != 0 ) return;
var img = document.getElementById("imgDoc");
if ( img == null ) return;
m_nOrgWidth = img.width;
m_nOrgHeight = img.height;
m_bIsGetSize = 1;
}function load_img(casenum, uid, picid)
{
imgDoc.src = "docviewimg.aspx?casenum=" + casenum + "&uid=" + uid + "&picid=" + picid
}//-->
</script>
</html>怎么这两页面都有这功能 我就搞不懂了``` 求高手``<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>温州房产档案查询系统</title>
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body id="imgBody">
<script language="javascript">var cx = window.screen.availWidth;
var cy = window.screen.availHeight;//alert( cx + "," + cy );window.parent.window.moveTo(0, 0);
window.parent.window.resizeTo( cx, cy );var w = cx - 350;
var h = cy - 300;
//var sTxt = "<object id='axWCWebImage' classid='clsid:f677b009-1260-4abf-9d11-aae4a6d6413d'";
var sTxt = "<object id='axWCWebImage' classid='http:WCWebImage.dll#WCWebImage.UCWebImageX'";
sTxt += " width=" + w + " height=" + h + "></object>"
document.writeln( sTxt );
</script>
</body>
<script language="javascript">
<!--function load_img(picid)
{
var svrPath = "<% =m_sSvrPath %>";
//axWCWebImage.LoadImage(svrPath + "docviewimg.aspx?casenum=" + casenum + "&uid=" + uid + "&picid=" + picid);
axWCWebImage.LoadImage(svrPath + "docviewimg.aspx?picid=" + picid);
//axWCWebImage.LoadImage(picid);
//alert(svrPath + "docviewimg.aspx?picid=" + picid);
axWCWebImage.ZoomAll();
}function zoom_img_fit()
{ axWCWebImage.ZoomAll();
}function zoom_img_out()
{
axWCWebImage.ZoomScale(1.4);
}function zoom_img_in()
{
axWCWebImage.ZoomScale(0.7);
}function zoom_img_org()
{
axWCWebImage.ZoomToScale(1.0);
}function print_img()
{
axWCWebImage.ImagePrint();
}-->
</script>
</html>该怎么加这预览功能? 求高手```
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货