
<%
'/////获取ShowImgasp的绝对路径/////
Dim curFile
curFile=Servermappath(Requestservervariables("PATH_INFO"))
Dim curfilename,filename
'/////相对路径(存于数据库中)
cufilename=rs("ImgURL")
'/////因为ShowImgasp与images在同一目录,所以我们用instrrev获取images的路径/////
filename=left(curFile,instrrev(curFile,"\"))&cufilename
'/////建立GPS类实体/////
Dim GetPicSize
Set GetPicSize=new GPS
Set fs=ServerCreateObject("ScriptingFileSystemObject")
'/////获取类型/////
Dim PicSuffixName
PicSuffixName=fsGetExtensionName(filename)
Dim PD '//Picture Dimension
Dim PWidth,PHeight
Select Case PicSuffixName
Case "gif","bmp","jpg","png":
'/////调用GPS通用类中的GetImageSize函数获取尺寸/////
PD=GetPicSizeGetImageSize(filename)
PWidth=PD(1) '//获取宽度
PHeight=PD(2) '//获取高度
Case "swf"
PD=GetPicSizeGetImageSize(filename)
PWidth=PD(1) '//获取Flash宽度
PHeight=PD(2) '//获取Flash高度
Case Else
End Select
Set fs=Nothing
Set GetPicSize=Nothing
%>
因为你这样写的时候有可能还未加载完毕,而且大小是 imagewidth imageheight
imageonload = function(){
alert(imagewidth,imageheight]);
}
以上就是关于ASP 里如何获取图片的尺寸呀 谢谢!全部的内容,包括:ASP 里如何获取图片的尺寸呀 谢谢!、为什么js获取图片高度的值 都为0、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)