|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
问题是他们究竟是喜欢他们是使用软件时,速度快还是速度慢好.(当然在3秒以内).无论是他们输入资料时,查找资料时,分析资料时.Ihavereleasedthissourcecodeintothepublicdomain.Youmayuseit
withnostringsattached.
JustcallGetImageSizewithastringcontainingthefilename,and
itwillreturnauserdefinedtypeImageSize(seebelow)
Returnvaluesof0indicateanerrorofsomesort.Theerrorhandling
inthismoduleislimited.Thereis*NO*errorhandlingonthetest
form.ThisroutineislimitedtoXorYsizesof32767pixels,butthat
shouldnotbeaproblem.
Checkbackathttp://www.qtm.net/~davidc
Imayaddsupportformorefiletypes.
supportedinthisversion:
JPEG
GIF
PNG
ThisroutinedoesnotrequireanyroyaltyfeesforUnisysasit
doesnothingwiththecompressedpartofGIFfiles.Itsimplyreads
4bytestodetermineimagesize.
OptionExplicit
PublicWImgAsLong
PublicHImgAsLong
PublicTypeImageSize
WidthAsLong
HeightAsLong
EndType
PublicSubGetImageSize(sFileNameAsString)
OnErrorResumeNextyoullwanttochangethis
DimiFNAsInteger
DimbTemp(3)AsByte
DimlFlenAsLong
DimlPosAsLong
DimbHmsbAsByte
DimbHlsbAsByte
DimbWmsbAsByte
DimbWlsbAsByte
DimbBuf(7)AsByte
DimbDoneAsByte
DimiCountAsInteger
lFlen=FileLen(sFileName)
iFN=FreeFile
OpensFileNameForBinaryAsiFN
Get#iFN,1,bTemp()
PNGfile
IfbTemp(0)=&H89AndbTemp(1)=&H50AndbTemp(2)=&H4E_
AndbTemp(3)=&H47Then
Get#iFN,19,bWmsb
Get#iFN,20,bWlsb
Get#iFN,23,bHmsb
Get#iFN,24,bHlsb
GetImageSize.Width=CombineBytes(bWlsb,bWmsb)
GetImageSize.Height=CombineBytes(bHlsb,bHmsb)
WImg=CombineBytes(bWlsb,bWmsb)
HImg=CombineBytes(bHlsb,bHmsb)
EndIf
GIFfile
IfbTemp(0)=&H47AndbTemp(1)=&H49AndbTemp(2)=&H46_
AndbTemp(3)=&H38Then
Get#iFN,7,bWlsb
Get#iFN,8,bWmsb
Get#iFN,9,bHlsb
Get#iFN,10,bHmsb
GetImageSize.Width=CombineBytes(bWlsb,bWmsb)
GetImageSize.Height=CombineBytes(bHlsb,bHmsb)
WImg=CombineBytes(bWlsb,bWmsb)
HImg=CombineBytes(bHlsb,bHmsb)
EndIf
JPEGfile
IfbTemp(0)=&HFFAndbTemp(1)=&HD8AndbTemp(2)=&HFFThen
Debug.Print"JPEG"
lPos=3
Do
Do
Get#iFN,lPos,bBuf(1)
Get#iFN,lPos+1,bBuf(2)
lPos=lPos+1
LoopUntil(bBuf(1)=&HFFAndbBuf(2)&HFF)OrlPos>lFlen
ForiCount=0To7
Get#iFN,lPos+iCount,bBuf(iCount)
NextiCount
IfbBuf(0)>=&HC0AndbBuf(0)<=&HC3Then
bHmsb=bBuf(4)
bHlsb=bBuf(5)
bWmsb=bBuf(6)
bWlsb=bBuf(7)
bDone=1
Else
lPos=lPos+(CombineBytes(bBuf(2),bBuf(1)))+1
EndIf
LoopWhilelPos<lFlenAndbDone=0
GetImageSize.Width=CombineBytes(bWlsb,bWmsb)
GetImageSize.Height=CombineBytes(bHlsb,bHmsb)
WImg=CombineBytes(bWlsb,bWmsb)
HImg=CombineBytes(bHlsb,bHmsb)
EndIf
CloseiFN
EndSub
PrivateFunctionCombineBytes(lsbAsByte,msbAsByte)AsLong
CombineBytes=CLng(lsb+(msb*256))
EndFunction
</p>Access是一种桌面数据库,只适合数据量少的应用,在处理少量数据和单机访问的数据库时是很好的,效率也很高。但是它的同时访问客户端不能多于4个。access数据库有一定的极限,如果数据达到100M左右,很容易造成服务器iis假死,或者消耗掉服务器的内存导致服务器崩溃。 |
|