Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: explanation, gurus? :-) (image memory representation)

From: fsievert:uos at: 21-Aug-2001 17:59

> > It would be great if more Rebol types were supported by the > > /library interface. (Image! should be my first choice!).
I had this problem before and have a sollution. You can create an string! out of the image! which uses the same memory-area. Example:
>> im: make image! 10x10
== make image! [10x10 #{ 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000...
>> parse im [str:]
== false
>> str
== {^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^...
>> change str "hello"
== {^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^...
>> im
== make image! [10x10 #{ 68656C6F0000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000... You can give str to the library-function and it will change your image!. I used this for a program. Hope that helps, Frank