文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > asp常用代码大全
侵权投诉

asp常用代码大全

asp常用代码大全

::::::::::::::::::::::::::::::::::::::::::
'::: :::
'::: This function does most of the real work. It will attempt :::
'::: to read any file, regardless of the extension, and will :::
'::: identify if it is a graphical image. :::
'::: :::
'::: Passed: :::
'::: flnm => Filespec of file to read :::
'::: width => width of image :::
'::: height => height of image :::
'::: depth => color depth (in number of colors) :::
'::: strImageType=> type of image (e.g. GIF, BMP, etc.) :::
'::: :::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
function gfxSpex(flnm, width, height, depth, strImageType)
dim strPNG
dim strGIF
dim strBMP
dim strType
strType = ""
strImageType = "(unknown)"
gfxSpex = False
strPNG = chr(137) & chr(80) & chr(78)
strGIF = "GIF"
strBMP = chr(66) & chr(77)
strType = GetBytes(flnm, 0, 3)
if strType = strGIF then ' is GIF
strImageType = "GIF"
Width = lngConvert(GetBytes(flnm, 7, 2))
Height = lngConvert(GetBytes(flnm, 9, 2))
Depth = 2 ^ ((asc(GetBytes(flnm, 11, 1)) and 7) + 1)
gfxSpex = True
elseif left(strType, 2) = strBMP then ' is BMP
strImageType = "BMP"
Width = lngConvert(GetBytes(flnm, 19, 2))
Height = lngConvert(GetBytes(flnm, 23, 2))
Depth = 2 ^ (asc(GetBytes(flnm, 29, 1)))
gfxSpex = True
elseif strType = strPNG then ' Is PNG
strImageType = "PNG"
Width = lngConvert2(GetBytes(flnm, 19, 2))
Height = lngConvert2(GetBytes(flnm, 23, 2))
Depth = getBytes(flnm, 25, 2)
select case asc(right(Depth,1))
case 0
Depth = 2 ^ (asc(left(Depth, 1)))
gfxSpex = True
case 2
Depth = 2 ^ (asc(left(Depth, 1)) * 3)
gfxSpex = True
case 3
Depth = 2 ^ (asc(left(Depth, 1))) '8
gfxSpex = True
case 4
Depth = 2 ^ (asc(left(Depth, 1)) * 2)
gfxSpex = True
case 6
Depth = 2 ^ (asc(left(Depth, 1)) * 4)
gfxSpex = True
case else
Depth = -1
end select 



else
strBuff = GetBytes(flnm, 0, -1) ' Get all bytes from file
lngSize = len(strBuff)
flgFound = 0
strTarget = chr(255) & chr(216) & chr(255)
flgFound = instr(strBuff, strTarget)
if flgFound = 0 then
exit function
end if
strImageType = "JPG"
lngPos = flgFound + 2
ExitLoop = false
do while ExitLoop = False and lngPos < lngSize 



do while asc(mid(strBuff, lngPos, 1)) = 255 and lngPos < lngSize
lngPos = lngPos + 1
loop
if asc(mid(strBuff, lngPos, 1)) < 192 or asc(mid(strBuff, lngPos, 1)) > 195 then
lngMarkerSize = lngConvert2(mid(strBuff, lngPos + 1, 2))
lngPos = lngPos + lngMarkerSize + 1
else
ExitLoop = True
end if
loop
'
if ExitLoop = False then
Width = -1
Height = -1
Depth = -1
else
Height = lngConvert2(mid(strBuff, lngPos + 4, 2))
Width = lngConvert2(mid(strBuff, lngPos + 6, 2))
Depth = 2 ^ (asc(mid(strBuff, lngPos + 8, 1)) * 8)
gfxSpex = True
end if 



end if
end function 



':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: Test Harness :::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 



' To test, we'll just try to

上一页第4页

你可能喜欢

  • 单片机原理课后答案
  • 数据库连接代码
  • 数据库操作
  • 网页html代码大全
  • Javascript基础教程
  • 网页特效代码
  • Java入门教程

热门文档

相关文档

  • ASP常用特效代码大全

    [/WITCODE] 常用ASP特效代码-网页制作代码小技巧-12008-10-18 12:181.设置滚动条颜色 scrollbar-3d-light-color 立体滚动条亮边的颜色(设置滚动条的颜色) ...

  • 常用代码集锦ASP

    常用代码集锦ASP_IT/计算机_专业资料。常用代码集锦ASP ●显示页面加载时间 ...门派:无门无派 注册:2005 年 6 月 2 日 楼主 整站系统源码下载大集合!!!...

  • ASP代码大全

    ASP代码大全_计算机软件及应用_IT/计算机_专业资料。邮件方面: CDONTS: <% ...在此把一些实用性很强的代码奉献出来,与大家共同分享 ... 1.生成日历 脚本...

  • asp一般代码大全

    asp一般代码大全_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 asp一般代码大全_IT/计算机_专业资料。asp asp常用代码 asp代码大全...

  • 经典ASP代码大集合

    经典ASP代码大集合_IT/计算机_专业资料。经典ASP代码大集合经典ASP 代码大集合...(this.form.list)"> 选中所有显示记录 转贴经典实用的代码: 1、关闭窗口在...

  • asp常用代码

    8页 免费 ASP建站十大常用程序代码完... 38页 免费 一些常用的ASP代码 10页 免费 asp常用代码集锦 17页 1财富值 asp常用代码 18页 免费...

  • ASP实用大全

    38页 免费 ASP代码大全 52页 1财富值 ASP实用大全-ASP基础 47页 免费 asp注册登陆系统源代码 8页 免费 5分钟编写一个ASP论坛 11页 免费...

  • ASP实用大全-ASP基础

    38页 免费 ASP代码大全 52页 1财富值 asp实用基础教材 54页 免费 ASP+IIS配置 11页 1财富值 ASP基础教程之实例学习ASP 13页 免费...

  • ASP编程常用代码精选集合(三)

    ASP建站十大常用程序代码完... 38页 免费 ASP代码大全 52页 1财富值 asp注册登陆系统源代码 8页 免费 ASP添加、删除、修改代码 ... 2页 免费 5分钟编写一...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email