快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

判定GIF图像尺寸的方式

这里是我根据gif图像格式想出来的判定gif图像尺寸的方式,请大家给点意见

up.htm

<html>
<body>
<form action="up.asp" ENCTYPE="multipart/form-data" method="post">
<table border=0 width=100% cellspacing="0">
<tr>
<td width="30%">请选择您要上传的gif图片:</td>
<td width="70%"><input type="file" name="pic" style="font-size:10pt;"></td>
</tr>
</table>
<p align="center"><input type="submit" value="提交" style="font-size:9pt;background-color:#54B060;color:white;">
</form>
</body>
</html>


up.asp

<%

FormSize = Request.TotalBytes
FormData = Request.BinaryRead( FormSize )

bncrlf=chrb(13) & chrb(10)
divider=leftb(formdata,instrb(formdata,bncrlf)-1)
datastart=instrb(formdata,bncrlf & bncrlf)+4
dataend=instrb(datastart+1,formdata,divider)-datastart
Image=midb(formdata,datastart,dataend)

head_version = Ascb( midb( Image,1,3 ) )
head_subversion = Ascb( midb( Image,4,3 ) )

head_width_l = Ascb( midb( Image,7,1 ) )
head_width_h = Ascb( midb( Image,8,1 ) )

head_height_l = Ascb( midb( Image,9,1 ) )
head_height_h = Ascb( midb( Image,10,1 ) )

head_colors = Ascb( midb( Image, 11, 1 ) )

head_width_h = head_width_h * 256

head_height_h = head_height_h * 256


head_colors = head_colors And &H07

Response.Write "图像大小为" & head_width_h + head_width_l & "x" & head_height_h + head_height_l _
& "x" & 2^( head_colors + 1 )


%>
返回类别: 教程
上一教程: ASP中使用SESSION变量的优缺点
下一教程: BBS的数据结构和存储过程(二)

您可以阅读与"判定GIF图像尺寸的方式"相关的教程:
· 一个取图片尺寸的类,支持JPG,GIF,PNG
· ASP中处理数据库图像的方式
· 利用ASP获得图象的实际尺寸的示例
· 通过ADODB.STREAM取得图像(BMP JPG PNG GIF SWF)的高度和宽度
· ASP中存储过程调用的两种方法,以及不采用存储过程的方法比较
    微笑服务 优质保证 索取样品