<%
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: bmp, gif, jpg e png :::
':::: Original: junyd :::::::::::::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::: ::::
'::: essa coisa pode obter bytes de BMP, GIF, JPG e PNG Pictures :::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
função getbytes (flnm, deslocamento, bytes)
Dim objfso
Dim objftemp
ObjTextStream dim
Dim lngSize
em erro de erro em seguida
Set objfso = createObject (script.filesystemoBject)
'Primeiro, obtemos filmes
Defina objftemp = objfso.getFile (flnm)
lngsize = objftemp.size
defina objftemp = nada
fsoforReading = 1
Definir objTextStream = objfso.opentExtfile (flnm, fsoforReading)
Se deslocamento> 0 então
strbuff = objTextStream.read (deslocamento - 1)
final se
Se bytes = -1, então 'pegue tudo!
GetBytes = objTextStream.read (lngsize) 'readall
outro
GetBytes = objTextStream.read (bytes)
final se
objTextStream.close
defina objTextStream = nada
defina objfso = nada
Função final
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::: ::::
'::: a seguir é a função de converter dois bytes em um valor unificado :::
'::: (Small Endian e Big Endian) :::
':::: ::::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
função lngconvert (strtemp)
lngConvert = clng (ASC (esquerda (strtemp, 1)) + ((ASC (direita (strtemp, 1) * 256))))
Função final
função lngConvert2 (strtemp)
lngConvert2 = clng (ASC (direita (strtemp, 1)) + ((ASC (esquerda (strtemp, 1) * 256))))
Função final
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::: ::::
'::: Este recurso faz a maior parte do trabalho real. Está disposto a tentar :::
'::: Leia qualquer arquivo :::
'::: Se for uma imagem de um gráfico, identifique. :::
':::: ::::
'::: Passado: :::
'::: flnm => FileSpec of File to Read :::
'::: largura => largura da imagem :::
'::: altura => altura da imagem :::
'::: profundidade => profundidade de cor (no número de cores) :::
'::: strimageType => tipo de imagem (por exemplo, gif, bmp, etc.) :::
':::: ::::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
função gfxSpex (flnm, largura, altura, profundidade, estréia)
Dim strpng
Dim strgif
Dim STRBMP
Dim strtype
strtype =
StrimageType = (desconhecido)
gfxSpex = false
strpng = chr (137) & ch (80) e chr (78)
strgif = gif
STRBMP = CHR (66) & Ch (77)
strtype = getBytes (flnm, 0, 3)
Se strtype = strgif, então 'é gif
strimageType = gif
Largura = lngConvert (getBytes (flnm, 7, 2))
Altura = lngConvert (getBytes (flnm, 9, 2))
Profundidade = 2 ^ ((ASC (getBytes (flnm, 11, 1)) e 7) + 1)
gfxSpex = true
elseif esquerdo (strtype, 2) = strbmp então 'é bmp
StrimageType = BMP