ASP program to get picture width and height

Source: Internet
Author: User
Tags chr end

<%
Class Imgwhinfo ' Get a picture of the width and height of classes, support Jpg,gif,png,bmp
Dim ASO

Private Sub Class_Initialize
Set aso=server.createobject ("ADODB. Stream ")
ASO. Mode=3
ASO. Type=1
ASO. Open
End Sub

Private Sub Class_Terminate
Err.Clear
Set aso=nothing
End Sub
Private Function bin2str (Bin)
Dim I, Str
For I=1 to LenB (Bin)
CLOW=MIDB (bin,i,1)
If ASCB (Clow) <128 Then
str = str & CHR (ASCB (Clow))
Else
I=i+1
If I <= LenB (Bin) Then str = str & CHR (ASCW (MidB (bin,i,1) &clow))
End If
Next
Bin2str = Str
End Function
Private Function num2str (num,base,lens)
Dim Ret
Ret = ""
while (Num>=base)
ret = (Num Mod Base) & RET
Num = (num-num Mod Base)/base
Wend

Num2str = Right (String (Lens, "0") & Num & Ret,lens)
End Function
Private Function Str2Num (str,base)
Dim Ret,i
Ret = 0
For I=1 to Len (STR)
RET = ret *base + Cint (Mid (str,i,1))
Next
Str2num=ret
End Function
Private Function Binval (Bin)
Dim Ret,i
Ret = 0
For I = LenB (Bin) to 1 Step-1
RET = ret *256 + AscB (MidB (bin,i,1))
Next
Binval=ret
End Function
Private Function BinVal2 (Bin)
Dim Ret,i
Ret = 0

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.