[thelist] Advanced VBScript Question

Warden, Matt mwarden at mattwarden.com
Sat Feb 2 16:40:01 CST 2002


On Feb 2, Ken Kogler had something to say about [thelist] Advanced VBScript...

>Is there a way to individually isolate one specific pixel within an
>image and then determine it's color?
>
>For example:
>
>---------BEGIN PSUEDOCODE------------
>
>  dim mypixel
>  mypixel = hexColorValueOf(imagePixel(100,100))
>
>----------END PSUEDOCODE-------------
>
>Would result in mypixel = #ffffff if that pixel was white...
>
>I've got a way to determine an image's width, height, and color depth,
>but I'm not sure if I can individually isolate and analyze a specific
>pixel.
>
>Any thoughts?

is this server-side? if so (or maybe even if not, depending on where this
script is going to be), you can use the filesystemobject to read the
image. you'll have to research how the various formats (gif, jpg) store
the information you want, but it's definitely do-able.

you might have better success, though, using the Stream object of ADO
(version 2.5 and up), as binary file manipulation (even reading) with the
filesystemobject is pretty much a pain in the ass.

more info on the stream object here:
<
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdobjstream.asp
>

hth,

--
mattwarden
mattwarden.com




More information about the thelist mailing list