欧美成人精品手机在线观看_69视频国产_动漫精品第一页_日韩中文字幕网 - 日本欧美一区二区

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發文檔 其他文檔  
 
網站管理員

一個取圖片尺寸的類,支持jpg,gif,png

admin
2010年7月7日 23:58 本文熱度 5886
[p]'i have released this source code into the public domain. you may use it[br]'with no strings attached.[br]'just call getimagesize with a string containing the filename, and[br]'it will return a user defined type 'imagesize' (see below)[br]'return values of 0 indicate an error of some sort. the error handling[br]'in this module is limited. there is *no* error handling on the test[br]'form. this routine is limited to x or y sizes of 32767 pixels, but that[br]'should not be a problem. [/p]
[p][br]'check back athttp://qtm.net/~davidc[br]'i may add support for more file types.[/p]
[p]'supported in this version:[br]'jpeg[br]'gif[br]'png[/p]
[p]'this routine does not require any royalty fees for unisys as it[br]'does nothing with the compressed part of gif files. it simply reads[br]'4 bytes to determine image size.[/p]
[p]option explicit[br]public wimg as long[br]public himg as long[br]public type imagesize[br]width as long[br]height as long[br]end type[/p]
[p]public sub getimagesize(sfilename as string)[br]on error resume next 'you'll want to change this[br]dim ifn as integer[br]dim btemp(3) as byte[br]dim lflen as long[br]dim lpos as long[br]dim bhmsb as byte[br]dim bhlsb as byte[br]dim bwmsb as byte[br]dim bwlsb as byte[br]dim bbuf(7) as byte[br]dim bdone as byte[br]dim icount as integer[/p]
[p]lflen = filelen(sfilename)[br]ifn = freefile[br]open sfilename for binary as ifn[br]get #ifn, 1, btemp()[/p]
[p]'png file[br]if btemp(0) = &h89 and btemp(1) = &h50 and btemp(2) = &h4e _[br]and btemp(3) = &h47 then[br]get #ifn, 19, bwmsb[br]get #ifn, 20, bwlsb[br]get #ifn, 23, bhmsb[br]get #ifn, 24, bhlsb[br]'getimagesize.width = combinebytes(bwlsb, bwmsb)[br]'getimagesize.height = combinebytes(bhlsb, bhmsb)[br]wimg = combinebytes(bwlsb, bwmsb)[br]himg = combinebytes(bhlsb, bhmsb)[br]end if[/p]
[p]'gif file[br]if btemp(0) = &h47 and btemp(1) = &h49 and btemp(2) = &h46 _[br]and btemp(3) = &h38 then[br]get #ifn, 7, bwlsb[br]get #ifn, 8, bwmsb[br]get #ifn, 9, bhlsb[br]get #ifn, 10, bhmsb[br]'getimagesize.width = combinebytes(bwlsb, bwmsb)[br]'getimagesize.height = combinebytes(bhlsb, bhmsb)[br]wimg = combinebytes(bwlsb, bwmsb)[br]himg = combinebytes(bhlsb, bhmsb)[br]end if[/p]
[p][br]'jpeg file[br]if btemp(0) = &hff and btemp(1) = &hd8 and btemp(2) = &hff then[br]debug.print "jpeg"[br]lpos = 3[br]do[br]do[br]get #ifn, lpos, bbuf(1)[br]get #ifn, lpos + 1, bbuf(2)[br]lpos = lpos + 1[br]loop until (bbuf(1) = &hff and bbuf(2) <> &hff) or lpos > lflen[/p]
[p]for icount = 0 to 7[br]get #ifn, lpos + icount, bbuf(icount)[br]next icount[br]if bbuf(0) >= &hc0 and bbuf(0) <= &hc3 then[br]bhmsb = bbuf(4)[br]bhlsb = bbuf(5)[br]bwmsb = bbuf(6)[br]bwlsb = bbuf(7)[br]bdone = 1[br]else[br]lpos = lpos + (combinebytes(bbuf(2), bbuf(1))) + 1[br]end if[br]loop while lpos < lflen and bdone = 0[br]'getimagesize.width = combinebytes(bwlsb, bwmsb)[br]'getimagesize.height = combinebytes(bhlsb, bhmsb)[br]wimg = combinebytes(bwlsb, bwmsb)[br]himg = combinebytes(bhlsb, bhmsb)[br]end if[br]close ifn[/p]
[p]end sub[br]private function combinebytes(lsb as byte, msb as byte) as long[br]combinebytes = clng(lsb + (msb * 256))[br]end function[/p]

該文章在 2010/7/7 23:58:28 編輯過
關鍵字查詢
相關文章
正在查詢...
點晴ERP是一款針對中小制造業的專業生產管理軟件系統,系統成熟度和易用性得到了國內大量中小企業的青睞。
點晴PMS碼頭管理系統主要針對港口碼頭集裝箱與散貨日常運作、調度、堆場、車隊、財務費用、相關報表等業務管理,結合碼頭的業務特點,圍繞調度、堆場作業而開發的。集技術的先進性、管理的有效性于一體,是物流碼頭及其他港口類企業的高效ERP管理信息系統。
點晴WMS倉儲管理系統提供了貨物產品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質期管理,貨位管理,庫位管理,生產管理,WMS管理系統,標簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務都免費,不限功能、不限時間、不限用戶的免費OA協同辦公管理系統。
Copyright 2010-2025 ClickSun All Rights Reserved