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

[REBOL] Re: Embedding images (from newbie)

From: chris:ross-gill at: 8-Aug-2001 10:06

Hi Ronald,
> I've already seen those embedded images (like "polished" in > Carl's VID Usage) > > How could I convert an image file into "text code"
The image! datatype takes the following form: make image! [size data] The size is, of course, a pair!, eg. 240x180 and the data is binary!. img: make image! [2x2 #{0000CC0000CC0000CC0000CC}] The data equates to colours similar to web hex values, except the order is BBGGRR. So the above example would give you 4 red pixels (B = 00 or 0, G 00 or 0 and R = CC or 204). To load external image data, use 'load or 'load-image (the latter caches images from the web/reb): img: load-image http://www.ross-gill.com/r/rg-rim.png probe img To put the image into the clipboard in REBOL format, save clipboard:// img Hope that's enough to get you started. - Chris