01 marzo 2003 alle 14:43:39 Modificato il 31 maggio 2003 alle 21:36:54Vorrei implementare un controllo per migliorare la gestione del mio Mod photoRadar e per farlo dovrei riuscire a sapere le dimensioni in pixel di un'immagine. Avete idea di come si possa fare ? Grazie ! (r)
--------------- http://www.tranquillamente.it Asp-Nuke: Io ci credo e voi ?
catenac Eliminato
0 Discussione
03 marzo 2003 alle 01:27:23 No, non ci credo ! Possibile che nessuno sa come fare ? --------------- http://www.tranquillamente.it Asp-Nuke: Io ci credo e voi ?
03 marzo 2003 alle 06:46:05 Non e' facile, in VB_Script non esistono funzioni per la gestione delle immagini! Tuttavia si puo' fare ugualmente:
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: ::: '::: This routine will attempt to identify any filespec passed ::: '::: as a graphic file (regardless of the extension). This will ::: '::: work with BMP, GIF, JPG and PNG files. ::: '::: ::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: Based on ideas presented by David Crowell ::: '::: (credit where due) ::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: blah blah blah blah blah blah blah blah blah blah blah blah ::: '::: blah blah blah blah blah blah blah blah blah blah blah blah ::: '::: blah blah Copyright *c* MM, Mike Shaffer blah blah ::: '::: blah blah ALL RIGHTS RESERVED WORLDWIDE blah blah ::: '::: blah blah Permission is granted to use this code blah blah ::: '::: blah blah in your projects, as long as this blah blah ::: '::: blah blah copyright notice is included blah blah ::: '::: blah blah blah blah blah blah blah blah blah blah blah blah ::: '::: blah blah blah blah blah blah blah blah blah blah blah blah ::: ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: ::: '::: This function gets a specified number of bytes from any ::: '::: file, starting at the offset (base 1) ::: '::: ::: '::: Passed: ::: '::: flnm => Filespec of file to read ::: '::: offset => Offset at which to start reading ::: '::: bytes => How many bytes to read ::: '::: ::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function GetBytes(flnm, offset, bytes)
Dim objFSO Dim objFTemp Dim objTextStream Dim lngSize
on error resume next
Set objFSO = CreateObject("Scripting.FileSystemObject")
' First, we get the filesize Set objFTemp = objFSO.GetFile(flnm) lngSize = objFTemp.Size set objFTemp = nothing
fsoForReading = 1 Set objTextStream = objFSO.OpenTextFile(flnm, fsoForReading)
if offset > 0 then strBuff = objTextStream.Read(offset - 1) end if
if bytes = -1 then ' Get All!
GetBytes = objTextStream.Read(lngSize) 'ReadAll
else
GetBytes = objTextStream.Read(bytes)
end if
objTextStream.Close set objTextStream = nothing set objFSO = nothing
end function
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: ::: '::: Functions to convert two bytes to a numeric value (long) ::: '::: (both little-endian and big-endian) ::: '::: ::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function lngConvert(strTemp) lngConvert = clng(asc(left(strTemp, 1)) + ((asc(right(strTemp, 1)) * 256))) end function
function lngConvert2(strTemp) lngConvert2 = clng(asc(right(strTemp, 1)) + ((asc(left(strTemp, 1)) * 256))) end function
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '::: ::: '::: This function does most of the real work. It will attempt ::: '::: to read any file, regardless of the extension, and will ::: '::: identify if it is a graphical image. ::: '::: ::: '::: Passed: ::: '::: flnm => Filespec of file to read ::: '::: width => width of image ::: '::: height => height of image ::: '::: depth => color depth (in number of colors) ::: '::: strImageType=> type of image (e.g. GIF, BMP, etc.) ::: '::: ::: '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function gfxSpex(flnm, width, height, depth, strImageType)
dim strPNG dim strGIF dim strBMP dim strType strType = "" strImageType = "(unknown)"
strFlnm => nome del file (input) lngWidth => larghezza (output) lngHeight => altezza (output) lngDepth => numero di colori (output) strImageType => tipo immagine: GIF, BMP, PNG, JPG (output)
La funzione restituisce FALSE se l'immagine non viene riconosciuta come tipo di immagine valido, e TRUE altrimenti (ma NON E' infallibile).
Ciao
Emu
--------------- development@aspnuke.it
catenac Eliminato
0 Discussione
03 marzo 2003 alle 12:56:06 Mamma mia quanta roba !!!! Grazie !!! Proverò presto !
--------------- http://www.tranquillamente.it Asp-Nuke: Io ci credo e voi ?
Log in
Cerca
Sostieni AspNuke
Un piccolo gesto per aiutarci a mantenere AspNuke.it online
Promo
MusicWebItalia.it Video Testi Traduzioni Spot Colonne sonore Accordi e Spartiti gratis.
Visitatori
Visitatori Correnti : 195 Membri : 0
Anna
Iscritti
Utenti: 18940
Ultimo iscritto : glauco Lista iscritti Messaggi privati: 3373Commenti: 2210Immagini: 39Downloads: 144Articoli: 49Pagine: 101Siti web: 558Notizie: 180Sondaggi: 11Preferiti: 5685130Post sui forum: 51195Libro degli ospiti: 4Eventi: 7