[racket] slideshow/pict and HTTP

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Aug 25 22:23:56 EDT 2012

Thanks for the kind words! Glad you found something useful.

Robby

On Sat, Aug 25, 2012 at 8:28 PM, Galler <lzgaller at optonline.net> wrote:
> Robby and Matt,
>
> I found one could very easily use the pict library to create bitmaps and
> disseminate over HTTP as png-encoded binary streams
>
> Which is really quite nice.
>
> Thanks much for your work. The 2006 paper is very clear.
>
>  Recursively defined picts structures are powerful abstractions
>
> ;STEP 1: Convert PICT to Bitmap
>
> (define x (pict->bitmap (cloud 100 50)))
>
> ;STEP 2: convert bitmap to png bytes. and base 64-encode them
>
> (define png (base64-encode (convert x 'png-bytes)))
>
> ;STEP 3: send bytes across network
>
> (printf "<html><body><img src='data:image/png;base64,\n
> ~A' alt='png failed to display' /></body></html>" png)
>
> R./
>
> Zack
>
>
>
>
>

Posted on the users mailing list.