当前位置:编程学习 > VB >>

ASP怎么实现图片按比例缩小

ASP一个函数要实现上传的图按比例缩小,不知道怎么实现!代码如下:


Function Pro_content()

Dim ShowID,ShowRs,Pic,pif
ShowID=safeRequest("ProID",1)
Set ShowRs = oConn.execute ("select * from Pro where Pro_ID="&ShowID)
%>

          <tr>
            <td width="44%" rowspan="4" align="center" valign="middle">

<%

if ShowRs("Pro_Pic") <> "" then 
Pic=ShowRs("Pro_Pic")
else
Pic="sys_images/nopic.gif"
end if
'Response.Write(pic)
'Response.End()
%>

<a href="<%=pic%>" target="_blank"><img border="0" src="<%=pic%>" width="400" height="200" /></a> <br />点击查看大图
<BR><BR><%=ShowRs("Pro_content")%>
        </table>
<%
ShowRs.Close
End Function


求高手帮帮! width="400" height="200" ,这个是固定的是吧,你想如果图片只有300宽120高就自动设为
width="300" height="120" 是吗?
补充:VB ,  网络编程
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,