Converting Hexadecimal in Binary

Alejandro Tejada capellan2000 at yahoo.com
Sat Jan 10 20:08:02 EST 2004


on Sat, 10 Jan 2004 11:24:00 -0700
Dar Scott wrote

> This might be faster yet:
> 
> repeat with i = 1 to length(asd) step 6
>     put null & binaryEncode("H*", char i to i+5 of
> asd) after qwe
> end repeat

This is 400% faster than original!!!!!!!!!!

So, putting the function inline cut the time
in half. Excellent!

Look at the three handlers working in this
stack:

<http://geocities.com/capellan2000/Faster_hexadecimal_to_binary.gz>

> > Do you have a function able to export an image
> > from MC/RR as RGB hexadecimal data?

> No, but here are a couple ideas.
> 
> 1.
> You can do the inverse of the above with imageData
> 
> or
> 
> 2.
> 
> A.  export as paint to a variable
>      That has a text header with 3-byte binary RGB
>      See:
>     
>
http://astronomy.swin.edu.au/~pbourke/dataformats/ppm/
> 
> B.  Break out the binary pixel data from the text
> header
>      You might try a regex that would work on any
>      P6 data, or by looking at the header you might
>      find that something like 'line 4 to -1" or some
>      other method would work for Rev P6 data.
> 
> C.  Apply the previously mentioned hex() function
>      only one time to the binary data.
> 
> D.  Done.

I'll try the first option.

> Both of these ignore mask and alpha.  The latter
> could be expanded to provide size data.

What do you mean with expanded? 
Is this the answer to my other question about 
the grow of pasted images in a stack? 
Is because the addition of maskdata or alphadata 
to the image pasted?

al

=====
Visit my site:
http://www.geocities.com/capellan2000/
Search the mail list:
http://mindlube.com/cgi-bin/search-use-rev.cgi

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus


More information about the use-livecode mailing list