当前位置: 首页 > 图文教程 > 网络编程 > ASP > 利用ASP获得图象的实际尺寸的示例

ASP
使用ASP和Word进行服务器端拼写检查
文本中首字母全改为大写
检测整数和长整数的函数
谈谈如何在不支持数据库的asp主页上运用ado
在多行文本框中显示读取信息
生成一个不重复的随即数字
网上追捕(很多实用的port)
用javascript隐藏超级链接的真实地址
给浏览器的滚动条加上颜色
asp+中是如何连接数据库ado+的
几个对图形进行动态处理的dhtml代码
域名登记查询(whois)很复杂吗--方法一
域名登记查询(whois)很复杂吗--方法二
用ASP创建多栏选项列表
asp中的一个奇怪的函数
瞒天过海html文件技术一瞥
如何在服务器上保存一定时间的信息
用ASP发 WAP MAIL(=)
创建弹出式“每日提示”窗口
用两行代码在浏览器中实现文件上传

利用ASP获得图象的实际尺寸的示例


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 36 ::
收藏到网摘: n/a

  <!--#include virtual="/learn/test/lib_graphicdetect.asp"-->
<html><head>
<TITLE>dbtable.asp</TITLE>
</head>
<body bgcolor="#FFFFFF">
<%
   graphic="images/learnaspiconmain.gif"
   HW = ReadImg(graphic)
   Response.Write graphic & " Dimensions: " & HW(0) & "x" & HW(1) & "<br>"
   response.write "<img src=""/" & graphic & """"
   response.write height=""" & HW(0) & """
   response.write width=""" & HW(0) & "">"
%>
</body></html>



The library that is included is:

<%
Dim HW

Function AscAt(s, n)
       AscAt = Asc(Mid(s, n, 1))
End Function

Function HexAt(s, n)
       HexAt = Hex(AscAt(s, n))
End Function


Function isJPG(fichero)
       If inStr(uCase(fichero), ".JPG") <> 0 Then
       isJPG = true
       Else
       isJPG = false
       End If
End Function


Function isPNG(fichero)
       If inStr(uCase(fichero), ".PNG") <> 0 Then
       isPNG = true
       Else
       isPNG = false
       End If
End Function


Function isGIF(fichero)
       If inStr(uCase(fichero), ".GIF") <> 0 Then
       isGIF = true
       Else
       isGIF = false
       End If
End Function


Function isBMP(fichero)
       If inStr(uCase(fichero), ".BMP") <> 0 Then
       isBMP = true
       Else
       isBMP = false
       End If
End Function


Function isWMF(fichero)
       If inStr(uCase(fichero), ".WMF") <> 0 Then
       isWMF = true
       Else
       isWMF = false
       End If
End Function


Function isWebImg(f)
       If isGIF(f) Or isJPG(f) Or isPNG(f) Or isBMP(f) Or isWMF(f) Then
       isWebImg = true
       Else
       isWebImg = true
       End If
End Function


Function ReadImg(fichero)
       If isGIF(fichero) Then
       ReadImg = ReadGIF(fichero)
       Else
       If isJPG(fichero) Then
       ReadImg = ReadJPG(fichero)
       Else
       If isPNG(fichero) Then
       ReadImg = ReadPNG(fichero)
       Else
       If isBMP(fichero) Then
   &nb